Bug 1363118 - Rename browser.shell.skipDefaultBrowserCheck pref for clarity. r?gijs
MozReview-Commit-ID: G7a825GWul
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -233,17 +233,17 @@ pref("general.autoScroll", true);
pref("browser.shell.checkDefaultBrowser", true);
pref("browser.shell.shortcutFavicons",true);
pref("browser.shell.mostRecentDateSetAsDefault", "");
#ifdef RELEASE_OR_BETA
pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", false);
#else
pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true);
#endif
-pref("browser.shell.skipDefaultBrowserCheck", true);
+pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", false);
pref("browser.shell.defaultBrowserCheckCount", 0);
pref("browser.defaultbrowser.notificationbar", false);
// 0 = blank, 1 = home (browser.startup.homepage), 2 = last visited page, 3 = resume previous browser session
// The behavior of option 3 is detailed at: http://wiki.mozilla.org/Session_Restore
pref("browser.startup.page", 1);
pref("browser.startup.homepage", "chrome://branding/locale/browserconfig.properties");
// Whether we should skip the homepage when opening the first-run page
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1065,17 +1065,17 @@ BrowserGlue.prototype = {
// Perform default browser checking.
if (ShellService) {
let shouldCheck = AppConstants.DEBUG ? false :
ShellService.shouldCheckDefaultBrowser;
const skipDefaultBrowserCheck =
Services.prefs.getBoolPref("browser.shell.skipDefaultBrowserCheckOnFirstRun") &&
- Services.prefs.getBoolPref("browser.shell.skipDefaultBrowserCheck");
+ !Services.prefs.getBoolPref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun");
const usePromptLimit = !AppConstants.RELEASE_OR_BETA;
let promptCount =
usePromptLimit ? Services.prefs.getIntPref("browser.shell.defaultBrowserCheckCount") : 0;
let willRecoverSession = false;
try {
let ss = Cc["@mozilla.org/browser/sessionstartup;1"].
@@ -1099,17 +1099,17 @@ BrowserGlue.prototype = {
}
let willPrompt = shouldCheck && !isDefault && !willRecoverSession;
// Skip the "Set Default Browser" check during first-run or after the
// browser has been run a few times.
if (willPrompt) {
if (skipDefaultBrowserCheck) {
- Services.prefs.setBoolPref("browser.shell.skipDefaultBrowserCheck", false);
+ Services.prefs.setBoolPref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", true);
willPrompt = false;
} else {
promptCount++;
}
if (usePromptLimit && promptCount > 3) {
willPrompt = false;
}
}
@@ -1661,18 +1661,19 @@ BrowserGlue.prototype = {
let clickCallback = (subject, topic, data) => {
if (topic != "alertclickcallback")
return;
this._openPreferences("sync");
}
AlertsService.showAlertNotification(null, title, body, true, null, clickCallback);
},
+ // eslint-disable-next-line complexity
_migrateUI: function BG__migrateUI() {
- const UI_VERSION = 44;
+ const UI_VERSION = 45;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
let currentUIVersion;
if (Services.prefs.prefHasUserValue("browser.migration.version")) {
currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
} else {
// This is a new profile, nothing to migrate.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -1956,16 +1957,25 @@ BrowserGlue.prototype = {
Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", animate);
Services.prefs.clearUserPref("browser.tabs.animate");
Services.prefs.clearUserPref("browser.fullscreen.animate");
Services.prefs.clearUserPref("alerts.disableSlidingEffect");
}
+ if (currentUIVersion < 45) {
+ const LEGACY_PREF = "browser.shell.skipDefaultBrowserCheck";
+ if (Services.prefs.prefHasUserValue(LEGACY_PREF)) {
+ Services.prefs.setBoolPref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun",
+ !Services.prefs.getBoolPref(LEGACY_PREF));
+ Services.prefs.clearUserPref(LEGACY_PREF);
+ }
+ }
+
// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},
// ------------------------------
// public nsIBrowserGlue members
// ------------------------------