Bug 1188281: Control search suggests prefs UI based on the unfied autocomplete pref. r=adw
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 05 Aug 2015 15:29:26 -0700
changeset 288265 213cb104d7b1b05e618238f69fc8e69da22e7781
parent 288264 b5168cc893e880f0fa3acf6daf5825b46a0bae74
child 288266 657bc9b41d7150028b81bf74ee4baa0b3aa07289
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1188281
milestone42.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 1188281: Control search suggests prefs UI based on the unfied autocomplete pref. r=adw
browser/app/profile/firefox.js
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/tests/browser_privacypane_5.js
browser/components/preferences/privacy.js
browser/components/preferences/tests/browser_privacypane_5.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -266,18 +266,23 @@ pref("browser.urlbar.doubleClickSelectsA
 #else
 pref("browser.urlbar.doubleClickSelectsAll", false);
 #endif
 
 // Control autoFill behavior
 pref("browser.urlbar.autoFill", true);
 pref("browser.urlbar.autoFill.typed", true);
 
+#ifdef NIGHTLY_BUILD
 // Use the new unifiedComplete component
 pref("browser.urlbar.unifiedcomplete", true);
+#else
+// Don't use the new unifiedComplete component
+pref("browser.urlbar.unifiedcomplete", false);
+#endif
 
 // 0: Match anywhere (e.g., middle of words)
 // 1: Match on word boundaries and then try matching anywhere
 // 2: Match only on word boundaries (e.g., after / or .)
 // 3: Match at the beginning of the url or title
 pref("browser.urlbar.matchBehavior", 1);
 pref("browser.urlbar.filter.javascript", true);
 
@@ -300,21 +305,17 @@ pref("browser.urlbar.restrict.searches",
 pref("browser.urlbar.match.title", "#");
 pref("browser.urlbar.match.url", "@");
 
 // The default behavior for the urlbar can be configured to use any combination
 // of the match filters with each additional filter adding more results (union).
 pref("browser.urlbar.suggest.history",              true);
 pref("browser.urlbar.suggest.bookmark",             true);
 pref("browser.urlbar.suggest.openpage",             true);
-#ifdef NIGHTLY_BUILD
 pref("browser.urlbar.suggest.searches",             true);
-#else
-pref("browser.urlbar.suggest.searches",             false);
-#endif
 
 // Limit the number of characters sent to the current search engine to fetch
 // suggestions.
 pref("browser.urlbar.maxCharsForSearchSuggestions", 20);
 
 // Restrictions to current suggestions can also be applied (intersection).
 // Typed suggestion works only if history is set to true.
 pref("browser.urlbar.suggest.history.onlyTyped",    false);
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -112,17 +112,18 @@ var gPrivacyPane = {
                      gPrivacyPane.updateAutostart);
     setEventListener("cookieExceptions", "command",
                      gPrivacyPane.showCookieExceptions);
     setEventListener("showCookiesButton", "command",
                      gPrivacyPane.showCookies);
     setEventListener("clearDataSettings", "command",
                      gPrivacyPane.showClearPrivateDataSettings);
 
-    document.getElementById("searchesSuggestion").hidden = !AppConstants.NIGHTLY_BUILD;
+    document.getElementById("searchesSuggestion").hidden = 
+      !Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete");
   },
 
   // HISTORY MODE
 
   /**
    * The list of preferences which affect the initial history mode settings.
    * If the auto start private browsing mode pref is active, the initial
    * history mode would be set to "Don't remember anything".
--- a/browser/components/preferences/in-content/tests/browser_privacypane_5.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_5.js
@@ -15,13 +15,13 @@ function test() {
   let tests = [
     test_locbar_suggestion_retention("history", true),
     test_locbar_suggestion_retention("bookmark", true),
     test_locbar_suggestion_retention("openpage", false),
     test_locbar_suggestion_retention("history", true),
     test_locbar_suggestion_retention("history", false),
   ];
 
-  if (AppConstants.NIGHTLY_BUILD)
+  if (Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete"))
     tests.push(test_locbar_suggestion_retention("searches", true));
 
   run_test_subset(tests);
 }
--- a/browser/components/preferences/privacy.js
+++ b/browser/components/preferences/privacy.js
@@ -66,17 +66,18 @@ var gPrivacyPane = {
     this.updateHistoryModePane();
     this.updatePrivacyMicroControls();
     this.initAutoStartPrivateBrowsingReverter();
 #ifdef NIGHTLY_BUILD
     this._initTrackingProtection();
 #endif
     this._initAutocomplete();
 
-    document.getElementById("searchesSuggestion").hidden = !AppConstants.NIGHTLY_BUILD;
+    document.getElementById("searchesSuggestion").hidden =
+      !Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete");
   },
 
   // HISTORY MODE
 
   /**
    * The list of preferences which affect the initial history mode settings.
    * If the auto start private browsing mode pref is active, the initial
    * history mode would be set to "Don't remember anything".
--- a/browser/components/preferences/tests/browser_privacypane_5.js
+++ b/browser/components/preferences/tests/browser_privacypane_5.js
@@ -15,13 +15,13 @@ function test() {
   let tests = [
     test_locbar_suggestion_retention("history", true),
     test_locbar_suggestion_retention("bookmark", true),
     test_locbar_suggestion_retention("openpage", false),
     test_locbar_suggestion_retention("history", true),
     test_locbar_suggestion_retention("history", false),
   ];
 
-  if (AppConstants.NIGHTLY_BUILD)
+  if (Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete"))
     tests.push(test_locbar_suggestion_retention("searches", true));
 
   run_test_subset(tests);
 }