# HG changeset patch # User Nicholas Nethercote # Date 1520375646 -39600 # Node ID d1d9ef8f7c0ecdc6b9d8fa33b8b2a9238e0ad64f # Parent f24b315875333bb5eb85d7951ed4b99e93651460 Bug 440908 - Convert sticky prefs in default pref files to the new syntax. r=glandium MozReview-Commit-ID: GgkNSsdGhBV diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1190,19 +1190,20 @@ pref("services.sync.prefs.sync.xpinstall // A preference that controls whether we should show the icon for a remote tab. // This pref has no UI but exists because some people may be concerned that // fetching these icons to show remote tabs may leak information about that // user's tabs and bookmarks. Note this pref is also synced. pref("services.sync.syncedTabs.showRemoteIcons", true); // Developer edition preferences #ifdef MOZ_DEV_EDITION -sticky_pref("lightweightThemes.selectedThemeID", "firefox-compact-dark@mozilla.org"); +pref("lightweightThemes.selectedThemeID", "firefox-compact-dark@mozilla.org", + sticky); #else -sticky_pref("lightweightThemes.selectedThemeID", ""); +pref("lightweightThemes.selectedThemeID", "", sticky); #endif // Whether the character encoding menu is under the main Firefox button. This // preference is a string so that localizers can alter it. pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties"); // Allow using tab-modal prompts when possible. pref("prompts.tab_modal.enabled", true); @@ -1214,17 +1215,17 @@ pref("browser.newtab.preload", true); // 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. pref("browser.newtabpage.enabled", true); // Toggles the directory tiles content of 'about:newtab'. -sticky_pref("browser.newtabpage.enhanced", true); +pref("browser.newtabpage.enhanced", true, sticky); // 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 diff --git a/devtools/shim/devtools-startup-prefs.js b/devtools/shim/devtools-startup-prefs.js --- a/devtools/shim/devtools-startup-prefs.js +++ b/devtools/shim/devtools-startup-prefs.js @@ -8,19 +8,19 @@ // process in JS, they can be defined in this file. // Note that this preference file follows Firefox release cycle. // Enable the JSON View tool (an inspector for application/json documents). pref("devtools.jsonview.enabled", true); // Default theme ("dark" or "light") #ifdef MOZ_DEV_EDITION -sticky_pref("devtools.theme", "dark"); +pref("devtools.theme", "dark", sticky); #else -sticky_pref("devtools.theme", "light"); +pref("devtools.theme", "light", sticky); #endif // Should the devtools toolbar be opened on startup pref("devtools.toolbar.visible", false); // Completely disable DevTools entry points, as well as all DevTools command line // arguments This should be merged with devtools.enabled, see Bug 1440675. pref("devtools.policy.disabled", false); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1060,33 +1060,33 @@ pref("toolkit.asyncshutdown.log", false) // Until bug 1361080 lands, we always consider them enabled. pref("devtools.enabled", true); // Enable deprecation warnings. pref("devtools.errorconsole.deprecation_warnings", true); #ifdef NIGHTLY_BUILD // Don't show the Browser Toolbox prompt on local builds / nightly -sticky_pref("devtools.debugger.prompt-connection", false); +pref("devtools.debugger.prompt-connection", false, sticky); #else -sticky_pref("devtools.debugger.prompt-connection", true); +pref("devtools.debugger.prompt-connection", true, sticky); #endif #ifdef MOZILLA_OFFICIAL // Disable debugging chrome -sticky_pref("devtools.chrome.enabled", false); +pref("devtools.chrome.enabled", false, sticky); // Disable remote debugging connections -sticky_pref("devtools.debugger.remote-enabled", false); +pref("devtools.debugger.remote-enabled", false, sticky); // enable JS dump() function. -sticky_pref("browser.dom.window.dump.enabled", false); +pref("browser.dom.window.dump.enabled", false, sticky); #else // In local builds, enable the browser toolbox by default -sticky_pref("devtools.chrome.enabled", true); -sticky_pref("devtools.debugger.remote-enabled", true); -sticky_pref("browser.dom.window.dump.enabled", true); +pref("devtools.chrome.enabled", true, sticky); +pref("devtools.debugger.remote-enabled", true, sticky); +pref("browser.dom.window.dump.enabled", true, sticky); #endif // Disable remote debugging protocol logging pref("devtools.debugger.log", false); pref("devtools.debugger.log.verbose", false); pref("devtools.debugger.remote-port", 6000); diff --git a/modules/libpref/test/unit/data/testPrefSticky.js b/modules/libpref/test/unit/data/testPrefSticky.js --- a/modules/libpref/test/unit/data/testPrefSticky.js +++ b/modules/libpref/test/unit/data/testPrefSticky.js @@ -1,2 +1,2 @@ pref("testPref.unsticky.bool", true); -sticky_pref("testPref.sticky.bool", false); +pref("testPref.sticky.bool", false, sticky); diff --git a/modules/libpref/test/unit/data/testPrefStickyUser.js b/modules/libpref/test/unit/data/testPrefStickyUser.js --- a/modules/libpref/test/unit/data/testPrefStickyUser.js +++ b/modules/libpref/test/unit/data/testPrefStickyUser.js @@ -1,5 +1,5 @@ -// testPrefSticky.js defined this pref as a sticky_pref(). Once a sticky +// testPrefSticky.js defined this pref as sticky. Once a sticky // pref has been changed, it's written as a user_pref(). // So this test file reflects that scenario. // Note the default in testPrefSticky.js is also false. user_pref("testPref.sticky.bool", false); diff --git a/modules/libpref/test/unit/test_stickyprefs.js b/modules/libpref/test/unit/test_stickyprefs.js --- a/modules/libpref/test/unit/test_stickyprefs.js +++ b/modules/libpref/test/unit/test_stickyprefs.js @@ -63,17 +63,17 @@ add_test(function notWrittenWhenUnchange ps.getBoolPref("testPref.sticky.bool"); Assert.ok(false, "expected failure reading this pref"); } catch (ex) { Assert.ok(ex, "exception reading regular pref"); } run_next_test(); }); -// Loading a sticky_pref then a user_pref for the same pref means it should +// Loading a sticky `pref` then a `user_pref` for the same pref means it should // always be written. add_test(function writtenOnceLoadedWithoutChange() { // Load the same pref file *as well as* a pref file that has a user_pref for // our sticky with the default value. It should be re-written without us // touching it. resetAndLoadAll(); // reset and re-read what we just wrote - it should be written. saveAndReload();