Bug 1216826 - Remove Suggestions Loader when using private tabs to prevent search suggestions. r=mcomella, a=ritu
authorPrabhjyot Singh Sodhi <prabhjyotsingh95@gmail.com>
Tue, 01 Dec 2015 22:39:50 -0800
changeset 305766 04630b5647aacbcdd8c1757981ad28a4ac7d5590
parent 305765 1708e3abd9b01d2c9fa81141c6b63c7a521d5cf9
child 305767 3c145973b6cb3234e0f786557918bb7fabc7eeb9
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella, ritu
bugs1216826
milestone44.0a2
Bug 1216826 - Remove Suggestions Loader when using private tabs to prevent search suggestions. r=mcomella, a=ritu
mobile/android/base/home/BrowserSearch.java
--- a/mobile/android/base/home/BrowserSearch.java
+++ b/mobile/android/base/home/BrowserSearch.java
@@ -235,16 +235,25 @@ public class BrowserSearch extends HomeF
         super.onDestroy();
 
         mSearchEngines = null;
     }
 
     @Override
     public void onHiddenChanged(boolean hidden) {
         if (!hidden) {
+            Tab tab = Tabs.getInstance().getSelectedTab();
+            final boolean isPrivate = (tab != null && tab.isPrivate());
+
+            // Removes Search Suggestions Loader if in private browsing mode
+            // Loader may have been inserted when browsing in normal tab
+            if (isPrivate) {
+                getLoaderManager().destroyLoader(LOADER_ID_SUGGESTION);
+            }
+
             GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("SearchEngines:GetVisible", null));
         }
         super.onHiddenChanged(hidden);
     }
 
     @Override
     public void onResume() {
         super.onResume();