Bug 1175434 - Hide "Find in page" bar when browser search UI is displayed. r=mcomella
authorSebastian Kaspari <s.kaspari@gmail.com>
Thu, 18 Jun 2015 20:30:14 +0200
changeset 268224 5eccb63fdec6c14c91b57eb4636ecf4261151fc1
parent 268223 b9608f525b1fd218a178eb25cd7b93d83cd35218
child 268225 192f73676e5def37504610d3ca62eee74d3d9d86
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1175434
milestone41.0a1
Bug 1175434 - Hide "Find in page" bar when browser search UI is displayed. r=mcomella
mobile/android/base/BrowserApp.java
mobile/android/base/FindInPageBar.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -2773,16 +2773,19 @@ public class BrowserApp extends GeckoApp
         // SearchEngineBar above the keyboard. However, adjusting the window size
         // when hiding the keyboard results in graphical glitches where the keyboard was
         // because nothing was being drawn underneath (bug 933422). This can be
         // prevented drawing content under the keyboard (i.e. in the Window).
         //
         // We do this here because there are glitches when unlocking a device with
         // BrowserSearch in the foreground if we use BrowserSearch.onStart/Stop.
         getActivity().getWindow().setBackgroundDrawableResource(android.R.color.white);
+
+        // Hide potentially visible "find in page" bar (bug 1175434).
+        mFindInPageBar.hide();
     }
 
     private void hideBrowserSearch() {
         if (!mBrowserSearch.getUserVisibleHint()) {
             return;
         }
 
         // To prevent overdraw, the HomePager is hidden when BrowserSearch is displayed:
--- a/mobile/android/base/FindInPageBar.java
+++ b/mobile/android/base/FindInPageBar.java
@@ -91,16 +91,21 @@ public class FindInPageBar extends Linea
         mFindText.requestFocus();
 
         // handleMessage() receives response message and determines initial state of softInput
         GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("TextSelection:Get", REQUEST_ID));
         GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("FindInPage:Opened", null));
     }
 
     public void hide() {
+        if (!mInflated) {
+            // There's nothing to hide yet.
+            return;
+        }
+
         // Always clear the Find string, primarily for privacy.
         mFindText.setText("");
 
         setVisibility(GONE);
         getInputMethodManager(mFindText).hideSoftInputFromWindow(mFindText.getWindowToken(), 0);
         GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("FindInPage:Closed", null));
     }