Fix portrait's fixed title bar

 Bug: 6468013

Change-Id: Ia6ee9645df9ebb8aa98734efef45b57db94651f7
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index bb44336..e3f5986 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -91,6 +91,7 @@
     protected FrameLayout mContentView;
     protected FrameLayout mCustomViewContainer;
     protected FrameLayout mFullscreenContainer;
+    private FrameLayout mFixedTitlebarContainer;
 
     private View mCustomView;
     private WebChromeClient.CustomViewCallback mCustomViewCallback;
@@ -126,6 +127,8 @@
                 .getDecorView().findViewById(android.R.id.content);
         LayoutInflater.from(mActivity)
                 .inflate(R.layout.custom_screen, frameLayout);
+        mFixedTitlebarContainer = (FrameLayout) frameLayout.findViewById(
+                R.id.fixed_titlebar_container);
         mContentView = (FrameLayout) frameLayout.findViewById(
                 R.id.main_content);
         mCustomViewContainer = (FrameLayout) frameLayout.findViewById(
@@ -844,4 +847,17 @@
         }
 
     }
+
+    public void addFixedTitleBar(View view) {
+        mFixedTitlebarContainer.addView(view);
+    }
+
+    public void setContentViewMarginTop(int margin) {
+        LinearLayout.LayoutParams params =
+                (LinearLayout.LayoutParams) mContentView.getLayoutParams();
+        if (params.topMargin != margin) {
+            params.topMargin = margin;
+            mContentView.setLayoutParams(params);
+        }
+    }
 }