Bug 1606390 Convert browser.newtabpage.enabled to a static pref r=Gijs

Converts `browser.newtabpage.enabled` into a static pref. Removes their varcache pref declaration. `signon.management.page.enabled` in the same file will be removed instead (Bug 1606888) as it is no longer needed.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kristen Wright 2020-01-03 22:11:33 +00:00
parent c027dd90b4
commit 185749a261
4 changed files with 10 additions and 14 deletions

View File

@ -1256,9 +1256,6 @@ pref("prompts.tab_modal.enabled", true);
// Activates preloading of the new tab url.
pref("browser.newtab.preload", true);
// Indicates if about:newtab shows content (enabled) or just blank
pref("browser.newtabpage.enabled", true);
// Activity Stream prefs that control to which page to redirect
#ifndef RELEASE_OR_BETA
pref("browser.newtabpage.activity-stream.debug", false);

View File

@ -12,6 +12,7 @@
#include "nsIURI.h"
#include "nsIProtocolHandler.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/Preferences.h"
#include "nsServiceManagerUtils.h"
@ -20,7 +21,6 @@ namespace browser {
NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)
bool AboutRedirector::sNewTabPageEnabled = false;
bool AboutRedirector::sAboutLoginsEnabled = false;
static const uint32_t ACTIVITY_STREAM_FLAGS =
@ -157,13 +157,6 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
NS_ENSURE_SUCCESS(rv, rv);
static bool sNTPEnabledCacheInited = false;
if (!sNTPEnabledCacheInited) {
Preferences::AddBoolVarCache(&AboutRedirector::sNewTabPageEnabled,
"browser.newtabpage.enabled");
sNTPEnabledCacheInited = true;
}
static bool sAboutLoginsCacheInited = false;
if (!sAboutLoginsCacheInited) {
Preferences::AddBoolVarCache(&AboutRedirector::sAboutLoginsEnabled,
@ -176,9 +169,10 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
nsAutoCString url;
// Let the aboutNewTabService decide where to redirect for about:home and
// enabled about:newtab. Disabledx about:newtab page uses fallback.
// enabled about:newtab. Disabled about:newtab page uses fallback.
if (path.EqualsLiteral("home") ||
(sNewTabPageEnabled && path.EqualsLiteral("newtab"))) {
(StaticPrefs::browser_newtabpage_enabled() &&
path.EqualsLiteral("newtab"))) {
nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -25,7 +25,6 @@ class AboutRedirector : public nsIAboutModule {
private:
static bool sAboutLoginsEnabled;
static bool sNewTabPageEnabled;
};
} // namespace browser

View File

@ -885,6 +885,12 @@
value: false
mirror: always
# Indicates if about:newtab shows content (enabled) or just blank.
- name: browser.newtabpage.enabled
type: bool
value: true
mirror: always
# Blocked plugin content
- name: browser.safebrowsing.blockedURIs.enabled
type: bool