Bug 1426864 - Determine private mode via browser toolbar, 2nd edition. r=nechen
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 22 Dec 2017 18:51:11 +0100
changeset 449205 36b69642c15c332a26834289db75c5aaeab1c4d4
parent 449204 90f70240f40956ab6eba75ecb8f985bb92a8ac22
child 449206 cd76b35cf19b92c2c79a15805b48fabf2e566e0a
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnechen
bugs1426864, 1426613
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1426864 - Determine private mode via browser toolbar, 2nd edition. r=nechen Similar to maybeSwitchToTab in bug 1426613, a search might be launched while we don't have a selected tab yet. Therefore we determine private mode state via the browser toolbar instead. MozReview-Commit-ID: 4idUR8v7MCx
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -4305,17 +4305,17 @@ public class BrowserApp extends GeckoApp
     }
 
     // BrowserSearch.OnSearchListener
     @Override
     public void onSearch(SearchEngine engine, final String text, final TelemetryContract.Method method) {
         // Don't store searches that happen in private tabs. This assumes the user can only
         // perform a search inside the currently selected tab, which is true for searches
         // that come from SearchEngineRow.
-        if (!Tabs.getInstance().getSelectedTab().isPrivate()) {
+        if (!mBrowserToolbar.isPrivateMode()) {
             storeSearchQuery(text);
         }
 
         // We don't use SearchEngine.getEngineIdentifier because it can
         // return a custom search engine name, which is a privacy concern.
         final String identifierToRecord = (engine.identifier != null) ? engine.identifier : "other";
         recordSearch(GeckoSharedPrefs.forProfile(this), identifierToRecord, method);
         openUrlAndStopEditing(text, engine.name);