Remove second url bar

       Remove the overlay "fake" titlebar by telling the
       WebView where to render the embedded titlebar
       Simplify focus handling
       requires Ic979b641c8cc80acb83eeab49c4f700fc5c50e72
       in frameworks/base

Change-Id: I7896cd731949fdcc47cd18abfee5ef947b0e8cee
diff --git a/src/com/android/browser/TitleBarBase.java b/src/com/android/browser/TitleBarBase.java
index 024f83c..1e944f1 100644
--- a/src/com/android/browser/TitleBarBase.java
+++ b/src/com/android/browser/TitleBarBase.java
@@ -23,7 +23,9 @@
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.LayerDrawable;
 import android.graphics.drawable.PaintDrawable;
+import android.view.Gravity;
 import android.view.View;
+import android.widget.AbsoluteLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 
@@ -76,4 +78,24 @@
     /* package */ void setInVoiceMode(boolean inVoiceMode) {}
 
     /* package */ void setIncognitoMode(boolean incognito) {}
+
+    void setTitleGravity(int gravity) {
+        int newTop = 0;
+        if (gravity != Gravity.NO_GRAVITY) {
+            View parent = (View) getParent();
+            if (parent != null) {
+                if (gravity == Gravity.TOP) {
+                    newTop = parent.getScrollY();
+                } else if (gravity == Gravity.BOTTOM) {
+                    newTop = parent.getScrollY() + parent.getHeight() - getHeight();
+                }
+            }
+        }
+        AbsoluteLayout.LayoutParams lp = (AbsoluteLayout.LayoutParams) getLayoutParams();
+        if (lp != null) {
+            lp.y = newTop;
+            setLayoutParams(lp);
+        }
+    }
+
 }