Bug 1516044 - Add search hand-off pref to firefox.js r=andreio
authorRicky Rosario <rickyrosario@gmail.com>
Wed, 16 Jan 2019 20:18:27 +0000
changeset 514130 8d7abfb509e974c6d5555c4fc1620904bd000182
parent 514129 d0e6b3cbbd16bce6ab704eb708464ab238d8ded3
child 514131 eb086e6c019f0cf11bedf536cbf601f401181e27
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersandreio
bugs1516044
milestone66.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 1516044 - Add search hand-off pref to firefox.js r=andreio MozReview-Commit-ID: IkH9is3LbUS Differential Revision: https://phabricator.services.mozilla.com/D16312
browser/app/profile/firefox.js
browser/components/newtab/lib/ActivityStream.jsm
browser/components/newtab/lib/PrefsFeed.jsm
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1292,16 +1292,22 @@ pref("browser.newtabpage.activity-stream
 
 // The pref that controls if the search shortcuts experiment is on
 pref("browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts", true);
 
 // ASRouter provider configuration
 pref("browser.newtabpage.activity-stream.asrouter.providers.cfr", "{\"id\":\"cfr\",\"enabled\":true,\"type\":\"local\",\"localProvider\":\"CFRMessageProvider\",\"frequency\":{\"custom\":[{\"period\":\"daily\",\"cap\":1}]}}");
 pref("browser.newtabpage.activity-stream.asrouter.providers.snippets", "{\"id\":\"snippets\",\"enabled\":true,\"type\":\"remote\",\"url\":\"https://snippets.cdn.mozilla.net/%STARTPAGE_VERSION%/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/\",\"updateCycleInMs\":14400000}");
 
+// The pref controls if search hand-off is enabled for Activity Stream.
+#ifdef NIGHTLY_BUILD
+pref("browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar", true);
+#else
+pref("browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar", false);
+#endif
 
 // Enable the DOM fullscreen API.
 pref("full-screen-api.enabled", true);
 
 // Startup Crash Tracking
 // number of startup crashes that can occur before starting into safe mode automatically
 // (this pref has no effect if more than 6 hours have passed since the last crash)
 pref("toolkit.startup.max_resumed_crashes", 3);
--- a/browser/components/newtab/lib/ActivityStream.jsm
+++ b/browser/components/newtab/lib/ActivityStream.jsm
@@ -188,20 +188,16 @@ const PREFS_CONFIG = new Map([
       }
       return searchShortcuts.join(",");
     },
   }],
   ["improvesearch.topSiteSearchShortcuts.havePinned", {
     title: "A comma-delimited list of search shortcuts that have previously been pinned",
     value: "",
   }],
-  ["improvesearch.handoffToAwesomebar", {
-    title: "Should the search box handoff to the Awesomebar?",
-    value: true,
-  }],
   ["asrouter.devtoolsEnabled", {
     title: "Are the asrouter devtools enabled?",
     value: false,
   }],
   ["asrouter.userprefs.cfr", {
     title: "Does the user allow CFR recommendations?",
     value: true,
   }],
--- a/browser/components/newtab/lib/PrefsFeed.jsm
+++ b/browser/components/newtab/lib/PrefsFeed.jsm
@@ -88,16 +88,23 @@ this.PrefsFeed = class PrefsFeed {
 
     // Read the pref for search shortcuts top sites experiment from firefox.js and store it
     // in our interal list of prefs to watch
     let searchTopSiteExperimentPrefValue = Services.prefs.getBoolPref(
       "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts");
     values["improvesearch.topSiteSearchShortcuts"] = searchTopSiteExperimentPrefValue;
     this._prefMap.set("improvesearch.topSiteSearchShortcuts", searchTopSiteExperimentPrefValue);
 
+    // Read the pref for search hand-off from firefox.js and store it
+    // in our interal list of prefs to watch
+    let handoffToAwesomebarPrefValue = Services.prefs.getBoolPref(
+      "browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar");
+    values["improvesearch.handoffToAwesomebar"] = handoffToAwesomebarPrefValue;
+    this._prefMap.set("improvesearch.handoffToAwesomebar", handoffToAwesomebarPrefValue);
+
     // Set the initial state of all prefs in redux
     this.store.dispatch(ac.BroadcastToContent({type: at.PREFS_INITIAL_VALUES, data: values}));
 
     this._migratePrefs();
     this._setPrerenderPref();
   }
 
   removeListeners() {