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 291776 04630b5647aacbcdd8c1757981ad28a4ac7d5590
parent 291775 1708e3abd9b01d2c9fa81141c6b63c7a521d5cf9
child 291777 3c145973b6cb3234e0f786557918bb7fabc7eeb9
push id8802
push usercbook@mozilla.com
push dateFri, 04 Dec 2015 14:11:24 +0000
treeherdermozilla-aurora@3c145973b6cb [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();