mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1433133 - remove unused prefs and exported bits from NewTabUtils.jsm, r=dao
MozReview-Commit-ID: 75xPd5hKexV --HG-- extra : rebase_source : 31fed5ea4584098112aa00f4d6189f9605a6520a
This commit is contained in:
parent
30d206fa1b
commit
0b74070674
@ -1167,7 +1167,6 @@ pref("services.sync.prefs.sync.browser.download.useDownloadDir", true);
|
||||
pref("services.sync.prefs.sync.browser.formfill.enable", true);
|
||||
pref("services.sync.prefs.sync.browser.link.open_newwindow", true);
|
||||
pref("services.sync.prefs.sync.browser.newtabpage.enabled", true);
|
||||
pref("services.sync.prefs.sync.browser.newtabpage.enhanced", true);
|
||||
pref("services.sync.prefs.sync.browser.newtabpage.pinned", true);
|
||||
pref("services.sync.prefs.sync.browser.offline-apps.notify", true);
|
||||
pref("services.sync.prefs.sync.browser.safebrowsing.phishing.enabled", true);
|
||||
@ -1257,29 +1256,10 @@ pref("prompts.tab_modal.enabled", true);
|
||||
// Activates preloading of the new tab url.
|
||||
pref("browser.newtab.preload", true);
|
||||
|
||||
// Remembers if the about:newtab intro has been shown
|
||||
// NOTE: This preference is unused but was not removed in case
|
||||
// this information will be valuable in the future.
|
||||
pref("browser.newtabpage.introShown", false);
|
||||
|
||||
// Toggles the content of 'about:newtab'. Shows the grid when enabled.
|
||||
// Is supposed to toggle something to do with about:newtab . Doesn't seem to do
|
||||
// anything in activity stream. bug 1443646 covers dealing with this.
|
||||
pref("browser.newtabpage.enabled", true);
|
||||
|
||||
// Toggles the directory tiles content of 'about:newtab'.
|
||||
sticky_pref("browser.newtabpage.enhanced", true);
|
||||
|
||||
// enables Activity Stream inspired layout
|
||||
pref("browser.newtabpage.compact", false);
|
||||
|
||||
// enables showing basic placeholders for missing thumbnails
|
||||
pref("browser.newtabpage.thumbnailPlaceholder", false);
|
||||
|
||||
// number of rows of newtab grid
|
||||
pref("browser.newtabpage.rows", 3);
|
||||
|
||||
// number of columns of newtab grid
|
||||
pref("browser.newtabpage.columns", 5);
|
||||
|
||||
// Activity Stream prefs that control to which page to redirect
|
||||
pref("browser.newtabpage.activity-stream.prerender", true);
|
||||
#ifndef RELEASE_OR_BETA
|
||||
|
@ -1,7 +1,7 @@
|
||||
use mozprofile::preferences::Pref;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref DEFAULT: [(&'static str, Pref); 80] = [
|
||||
pub static ref DEFAULT: [(&'static str, Pref); 79] = [
|
||||
// Disable automatic downloading of new releases
|
||||
("app.update.auto", Pref::new(false)),
|
||||
|
||||
@ -33,11 +33,6 @@ lazy_static! {
|
||||
// use about:blank as new tab page
|
||||
("browser.newtabpage.enabled", Pref::new(false)),
|
||||
|
||||
// Assume the about:newtab pages intro panels have been shown
|
||||
// to not depend on which test runs first and happens to open
|
||||
// about:newtab
|
||||
("browser.newtabpage.introShown", Pref::new(true)),
|
||||
|
||||
// Never start the browser in offline mode
|
||||
("browser.offline", Pref::new(false)),
|
||||
|
||||
|
@ -499,9 +499,6 @@ class DesktopInstance(GeckoInstance):
|
||||
|
||||
# Turn off about:newtab and make use of about:blank instead for new opened tabs
|
||||
"browser.newtabpage.enabled": False,
|
||||
# Assume the about:newtab page"s intro panels have been shown to not depend on
|
||||
# which test runs first and happens to open about:newtab
|
||||
"browser.newtabpage.introShown": True,
|
||||
|
||||
# Background thumbnails in particular cause grief, and disabling thumbnails
|
||||
# in general can"t hurt - we re-enable them when tests need them
|
||||
|
@ -93,10 +93,6 @@ const RECOMMENDED_PREFS = new Map([
|
||||
// as it is picked up at runtime.
|
||||
["browser.newtabpage.enabled", false],
|
||||
|
||||
// Assume the about:newtab page's intro panels have been shown to not
|
||||
// depend on which test runs first and happens to open about:newtab
|
||||
["browser.newtabpage.introShown", true],
|
||||
|
||||
// Never start the browser in offline mode
|
||||
//
|
||||
// This should also be set in the profile prior to starting Firefox,
|
||||
|
@ -298,9 +298,6 @@ user_pref("browser.newtabpage.activity-stream.tippyTop.service.endpoint", "");
|
||||
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
|
||||
user_pref("browser.newtabpage.activity-stream.feeds.snippets", false);
|
||||
|
||||
// Don't fetch directory tiles data from real servers
|
||||
user_pref("browser.newtabpage.directory.source", 'data:application/json,{"testing":1}');
|
||||
|
||||
// Ensure UITour won't hit the network
|
||||
user_pref("browser.uitour.pinnedTabUrl", "http://%(server)s/uitour-dummy/pinnedTab");
|
||||
user_pref("browser.uitour.url", "http://%(server)s/uitour-dummy/tour");
|
||||
|
@ -112,7 +112,6 @@ DEFAULTS = dict(
|
||||
'browser.newtabpage.activity-stream.tippyTop.service.endpoint': '',
|
||||
'browser.newtabpage.activity-stream.feeds.section.topstories': False,
|
||||
'browser.newtabpage.activity-stream.feeds.snippets': False,
|
||||
'browser.newtabpage.introShown': True,
|
||||
'browser.safebrowsing.downloads.remote.url':
|
||||
'http://127.0.0.1/safebrowsing-dummy/downloads',
|
||||
'browser.safebrowsing.provider.google.gethashURL':
|
||||
|
@ -200,7 +200,6 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([
|
||||
["browser.cache.offline.enable", {what: RECORD_PREF_VALUE}],
|
||||
["browser.formfill.enable", {what: RECORD_PREF_VALUE}],
|
||||
["browser.newtabpage.enabled", {what: RECORD_PREF_VALUE}],
|
||||
["browser.newtabpage.enhanced", {what: RECORD_PREF_VALUE}],
|
||||
["browser.shell.checkDefaultBrowser", {what: RECORD_PREF_VALUE}],
|
||||
["browser.search.ignoredJAREngines", {what: RECORD_DEFAULTPREF_VALUE}],
|
||||
["browser.search.region", {what: RECORD_PREF_VALUE}],
|
||||
|
@ -38,13 +38,6 @@ XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function() {
|
||||
|
||||
// Boolean preferences that control newtab content
|
||||
const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled";
|
||||
const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
|
||||
|
||||
// The preference that tells the number of rows of the newtab grid.
|
||||
const PREF_NEWTAB_ROWS = "browser.newtabpage.rows";
|
||||
|
||||
// The preference that tells the number of columns of the newtab grid.
|
||||
const PREF_NEWTAB_COLUMNS = "browser.newtabpage.columns";
|
||||
|
||||
// The maximum number of results PlacesProvider retrieves from history.
|
||||
const HISTORY_RESULTS_LIMIT = 100;
|
||||
@ -208,11 +201,6 @@ var AllPages = {
|
||||
*/
|
||||
_enabled: null,
|
||||
|
||||
/**
|
||||
* Cached value that tells whether the New Tab Page feature is enhanced.
|
||||
*/
|
||||
_enhanced: null,
|
||||
|
||||
/**
|
||||
* Adds a page to the internal list of pages.
|
||||
* @param aPage The page to register.
|
||||
@ -250,24 +238,6 @@ var AllPages = {
|
||||
Services.prefs.setBoolPref(PREF_NEWTAB_ENABLED, !!aEnabled);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns whether the history tiles are enhanced.
|
||||
*/
|
||||
get enhanced() {
|
||||
if (this._enhanced === null)
|
||||
this._enhanced = Services.prefs.getBoolPref(PREF_NEWTAB_ENHANCED);
|
||||
|
||||
return this._enhanced;
|
||||
},
|
||||
|
||||
/**
|
||||
* Enables or disables the enhancement of history tiles feature.
|
||||
*/
|
||||
set enhanced(aEnhanced) {
|
||||
if (this.enhanced != aEnhanced)
|
||||
Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, !!aEnhanced);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the number of registered New Tab Pages (i.e. the number of open
|
||||
* about:newtab instances).
|
||||
@ -300,9 +270,6 @@ var AllPages = {
|
||||
case PREF_NEWTAB_ENABLED:
|
||||
this._enabled = null;
|
||||
break;
|
||||
case PREF_NEWTAB_ENHANCED:
|
||||
this._enhanced = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// and all notifications get forwarded to each page.
|
||||
@ -317,7 +284,6 @@ var AllPages = {
|
||||
*/
|
||||
_addObserver: function AllPages_addObserver() {
|
||||
Services.prefs.addObserver(PREF_NEWTAB_ENABLED, this, true);
|
||||
Services.prefs.addObserver(PREF_NEWTAB_ENHANCED, this, true);
|
||||
Services.obs.addObserver(this, "page-thumbnail:create", true);
|
||||
this._addObserver = function() {};
|
||||
},
|
||||
@ -326,68 +292,6 @@ var AllPages = {
|
||||
Ci.nsISupportsWeakReference])
|
||||
};
|
||||
|
||||
/**
|
||||
* Singleton that keeps Grid preferences
|
||||
*/
|
||||
var GridPrefs = {
|
||||
/**
|
||||
* Cached value that tells the number of rows of newtab grid.
|
||||
*/
|
||||
_gridRows: null,
|
||||
get gridRows() {
|
||||
if (!this._gridRows) {
|
||||
this._gridRows = Math.max(1, Services.prefs.getIntPref(PREF_NEWTAB_ROWS));
|
||||
}
|
||||
|
||||
return this._gridRows;
|
||||
},
|
||||
|
||||
/**
|
||||
* Cached value that tells the number of columns of newtab grid.
|
||||
*/
|
||||
_gridColumns: null,
|
||||
get gridColumns() {
|
||||
if (!this._gridColumns) {
|
||||
this._gridColumns = Math.max(1, Services.prefs.getIntPref(PREF_NEWTAB_COLUMNS));
|
||||
}
|
||||
|
||||
return this._gridColumns;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Initializes object. Adds a preference observer
|
||||
*/
|
||||
init: function GridPrefs_init() {
|
||||
Services.prefs.addObserver(PREF_NEWTAB_ROWS, this);
|
||||
Services.prefs.addObserver(PREF_NEWTAB_COLUMNS, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Uninitializes object. Removes the preference observers
|
||||
*/
|
||||
uninit: function GridPrefs_uninit() {
|
||||
Services.prefs.removeObserver(PREF_NEWTAB_ROWS, this);
|
||||
Services.prefs.removeObserver(PREF_NEWTAB_COLUMNS, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Implements the nsIObserver interface to get notified when the preference
|
||||
* value changes.
|
||||
*/
|
||||
observe: function GridPrefs_observe(aSubject, aTopic, aData) {
|
||||
if (aData == PREF_NEWTAB_ROWS) {
|
||||
this._gridRows = null;
|
||||
} else {
|
||||
this._gridColumns = null;
|
||||
}
|
||||
|
||||
AllPages.update();
|
||||
}
|
||||
};
|
||||
|
||||
GridPrefs.init();
|
||||
|
||||
/**
|
||||
* Singleton that keeps track of all pinned links and their positions in the
|
||||
* grid.
|
||||
@ -1838,10 +1742,6 @@ var Links = {
|
||||
// Build a list containing a copy of each provider's sortedLinks list.
|
||||
let linkLists = [];
|
||||
for (let provider of this._providers.keys()) {
|
||||
if (!AllPages.enhanced && provider != PlacesProvider) {
|
||||
// Only show history tiles if we're not in 'enhanced' mode.
|
||||
continue;
|
||||
}
|
||||
let links = this._providers.get(provider);
|
||||
if (links && links.sortedLinks) {
|
||||
linkLists.push(links.sortedLinks.slice());
|
||||
@ -2054,8 +1954,6 @@ var Telemetry = {
|
||||
let probes = [
|
||||
{ histogram: "NEWTAB_PAGE_ENABLED",
|
||||
value: AllPages.enabled },
|
||||
{ histogram: "NEWTAB_PAGE_ENHANCED",
|
||||
value: AllPages.enhanced },
|
||||
{ histogram: "NEWTAB_PAGE_PINNED_SITES_COUNT",
|
||||
value: PinnedLinks.links.length },
|
||||
{ histogram: "NEWTAB_PAGE_BLOCKED_SITES_COUNT",
|
||||
@ -2186,7 +2084,6 @@ var NewTabUtils = {
|
||||
uninit: function NewTabUtils_uninit() {
|
||||
if (this.initialized) {
|
||||
Telemetry.uninit();
|
||||
GridPrefs.uninit();
|
||||
BlockedLinks.removeObservers();
|
||||
}
|
||||
},
|
||||
@ -2239,11 +2136,8 @@ var NewTabUtils = {
|
||||
|
||||
links: Links,
|
||||
allPages: AllPages,
|
||||
linkChecker: LinkChecker,
|
||||
pinnedLinks: PinnedLinks,
|
||||
blockedLinks: BlockedLinks,
|
||||
gridPrefs: GridPrefs,
|
||||
placesProvider: PlacesProvider,
|
||||
activityStreamLinks: ActivityStreamLinks,
|
||||
activityStreamProvider: ActivityStreamProvider
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user