Don't embed titlebar in WebView

    Bug: 5032345

The titlebar gets attached to an overlay and tracks the scrolling
of the WebView at the top of the page.

Change-Id: I60b2163bb7a3642813823995278722455f566f36
diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/browser/XLargeUi.java
index 46149aa..6e37c15 100644
--- a/src/com/android/browser/XLargeUi.java
+++ b/src/com/android/browser/XLargeUi.java
@@ -28,13 +28,9 @@
 import android.os.Handler;
 import android.util.Log;
 import android.view.ActionMode;
-import android.view.Gravity;
 import android.view.KeyEvent;
 import android.view.Menu;
 import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.WebChromeClient.CustomViewCallback;
 import android.webkit.WebView;
 import android.webkit.WebViewClassic;
 
@@ -92,25 +88,11 @@
             checkTabCount();
             mPieControl = new PieControlXLarge(mActivity, mUiController, this);
             mPieControl.attachToContainer(mContentView);
-            WebView web = getWebView();
-            if (web != null) {
-                WebViewClassic.fromWebView(web).setEmbeddedTitleBar(null);
-
-            }
         } else {
             mActivity.getActionBar().show();
             if (mPieControl != null) {
                 mPieControl.removeFromContainer(mContentView);
             }
-            WebView web = getWebView();
-            if (web != null) {
-                if (mTitleBar.getParent() != null) {
-                    ViewGroup p = (ViewGroup) mTitleBar.getParent();
-                    p.removeView(mTitleBar);
-                }
-                WebViewClassic.fromWebView(web).setEmbeddedTitleBar(mTitleBar);
-            }
-            setTitleGravity(Gravity.NO_GRAVITY);
         }
         mTabBar.setUseQuickControls(mUseQuickControls);
         // We need to update the tabs with this change
@@ -200,11 +182,9 @@
         // Request focus on the top window.
         if (mUseQuickControls) {
             mPieControl.forceToTop(mContentView);
+            view.setTitleBar(null);
         } else {
-            // check if title bar is already attached by animation
-            if (mTitleBar.getParent() == null) {
-                WebViewClassic.fromWebView(view).setEmbeddedTitleBar(mTitleBar);
-            }
+            view.setTitleBar(mTitleBar);
         }
         mTabBar.onSetActiveTab(tab);
         if (tab.isInVoiceSearchMode()) {
@@ -269,13 +249,6 @@
         }
     }
 
-    @Override
-    protected void setTitleGravity(int gravity) {
-        if (!mUseQuickControls) {
-            super.setTitleGravity(gravity);
-        }
-    }
-
     // action mode callbacks
 
     @Override