Bug 1094324 - Set browser.newtabpage.enhanced default in prefs. r=adw
The current behavior is that if there is no user pref, it is set to true or false depending on the value of privacy.donottrackheader.enabled, but completely ignoring the global default. This patch changes the behavior such that: - browser.newtabpage.enhanced's default value is set as a global default - it is also set as sticky, so that even when the same value as the default is set, prefHasUserValue is true. - The introduction is not shown when the default for browser.newtabpage.enhanced is false. It is however shown when the pref is flipped for the first time.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
const PREF_INTRO_SHOWN = "browser.newtabpage.introShown";
|
||||
const PREF_UPDATE_INTRO_SHOWN = "browser.newtabpage.updateIntroShown";
|
||||
const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
|
||||
|
||||
// These consts indicate the type of intro/onboarding we show.
|
||||
const WELCOME = "welcome";
|
||||
@@ -205,6 +206,9 @@ let gIntro = {
|
||||
},
|
||||
|
||||
showIfNecessary: function() {
|
||||
if (!Services.prefs.getBoolPref(PREF_NEWTAB_ENHANCED)) {
|
||||
return;
|
||||
}
|
||||
if (!Services.prefs.getBoolPref(PREF_INTRO_SHOWN)) {
|
||||
this._onboardingType = WELCOME;
|
||||
this.showPanel();
|
||||
|
||||
@@ -54,6 +54,7 @@ let gPage = {
|
||||
// Update thumbnails to the new enhanced setting
|
||||
if (aData == "browser.newtabpage.enhanced") {
|
||||
this.update();
|
||||
gIntro.showIfNecessary();
|
||||
}
|
||||
|
||||
// Initialize the whole page if we haven't done that, yet.
|
||||
|
||||
Reference in New Issue
Block a user