Merge "No search pane while tapping search button after backing to "windows" view from "saved page" view."
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index e3c22bd..89eae70 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -54,6 +54,7 @@
     private int mActionBarHeight;
 
     boolean mAnimating;
+    boolean mShowNav = false;
 
     /**
      * @param browser
@@ -80,6 +81,8 @@
         if (mUseQuickControls) {
             mTitleBar.setShowProgressOnly(false);
         }
+        //Do nothing while at Nav show screen.
+        if (mShowNav) return;
         super.editUrl(clearInput, forceIME);
     }
 
@@ -131,6 +134,12 @@
         mTitleBar.cancelTitleBarAnimation(true);
         mTitleBar.setSkipTitleBarAnimations(true);
         super.setActiveTab(tab);
+
+        //if at Nav screen show, detach tab like what showNavScreen() do.
+        if (mShowNav) {
+            detachTab(mActiveTab);
+        }
+
         BrowserWebView view = (BrowserWebView) tab.getWebView();
         // TabControl.setCurrentTab has been called before this,
         // so the tab is guaranteed to have a webview
@@ -254,6 +263,7 @@
     }
 
     void showNavScreen() {
+        mShowNav = true;
         mUiController.setBlockEvents(true);
         if (mNavScreen == null) {
             mNavScreen = new NavScreen(mActivity, mUiController, this);
@@ -334,6 +344,7 @@
     }
 
     void hideNavScreen(int position, boolean animate) {
+        mShowNav = false;
         if (!showingNavScreen()) return;
         final Tab tab = mUiController.getTabControl().getTab(position);
         if ((tab == null) || !animate) {