Bug 1495517 - Migrate improvesearch.topSiteSearchShortcuts pref from ActivityStream.jsm to firefox.js r=k88hudson

Differential Revision: https://phabricator.services.mozilla.com/D7325

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ursula Sarracini 2018-10-02 15:37:51 +00:00
parent b55a01a61c
commit 3c481420de
3 changed files with 15 additions and 4 deletions

View File

@ -1251,6 +1251,14 @@ pref("browser.library.activity-stream.enabled", true);
// The remote FxA root content URL for the Activity Stream firstrun page.
pref("browser.newtabpage.activity-stream.fxaccounts.endpoint", "https://accounts.firefox.com/");
// The pref that controls if the search shortcuts experiment is on
#ifdef EARLY_BETA_OR_EARLIER
pref("browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts", true);
#else
pref("browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts", false);
#else
#endif
// Enable the DOM fullscreen API.
pref("full-screen-api.enabled", true);

View File

@ -167,10 +167,6 @@ const PREFS_CONFIG = new Map([
title: "Experiment to remove tiles that are the same as the default search",
value: true,
}],
["improvesearch.topSiteSearchShortcuts", {
title: "Experiment to show special top sites that perform keyword searches",
value: UpdateUtils.getUpdateChannel(true) !== "release",
}],
["improvesearch.topSiteSearchShortcuts.searchEngines", {
title: "An ordered, comma-delimited list of search shortcuts that we should try and pin",
// This pref is dynamic as the shortcuts vary depending on the region

View File

@ -105,6 +105,13 @@ this.PrefsFeed = class PrefsFeed {
values.fxa_endpoint = Services.prefs.getStringPref(
"browser.newtabpage.activity-stream.fxaccounts.endpoint", "https://accounts.firefox.com");
// 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);
// Set the initial state of all prefs in redux
this.store.dispatch(ac.BroadcastToContent({type: at.PREFS_INITIAL_VALUES, data: values}));