Bug 1297479 - create a pref to turn off UI to undo automatic migration for use by funnelcake builds, r?dolske
MozReview-Commit-ID: JZQuhMxxrXU
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1477,16 +1477,17 @@ pref("media.webspeech.synth.enabled", tr
pref("browser.esedbreader.loglevel", "Error");
pref("browser.laterrun.enabled", false);
pref("browser.migrate.automigrate.enabled", false);
// 4 here means the suggestion notification will be automatically
// hidden the 4th day, so it will actually be shown on 3 different days.
pref("browser.migrate.automigrate.daysToOfferUndo", 4);
+pref("browser.migrate.automigrate.ui.enabled", true);
// Enable browser frames for use on desktop. Only exposed to chrome callers.
pref("dom.mozBrowserFramesEnabled", true);
pref("extensions.pocket.enabled", true);
pref("signon.schemeUpgrades", true);
--- a/browser/components/migration/AutoMigrate.jsm
+++ b/browser/components/migration/AutoMigrate.jsm
@@ -4,16 +4,17 @@
"use strict";
this.EXPORTED_SYMBOLS = ["AutoMigrate"];
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
const kAutoMigrateEnabledPref = "browser.migrate.automigrate.enabled";
+const kUndoUIEnabledPref = "browser.migrate.automigrate.ui.enabled";
const kAutoMigrateStartedPref = "browser.migrate.automigrate.started";
const kAutoMigrateFinishedPref = "browser.migrate.automigrate.finished";
const kAutoMigrateBrowserPref = "browser.migrate.automigrate.browser";
const kAutoMigrateLastUndoPromptDateMsPref = "browser.migrate.automigrate.lastUndoPromptDateMs";
const kAutoMigrateDaysToOfferUndoPref = "browser.migrate.automigrate.daysToOfferUndo";
@@ -281,17 +282,18 @@ const AutoMigrate = {
if (browserId) {
return MigrationUtils.getBrowserName(browserId);
}
return null;
},
maybeShowUndoNotification(target) {
// The tab might have navigated since we requested the undo state:
- if (!this.canUndo() || target.currentURI.spec != "about:home") {
+ if (!this.canUndo() || target.currentURI.spec != "about:home" ||
+ !Preferences.get(kUndoUIEnabledPref, false)) {
return;
}
let win = target.ownerGlobal;
let notificationBox = win.gBrowser.getNotificationBox(target);
if (!notificationBox || notificationBox.getNotificationWithValue("abouthome-automigration-undo")) {
return;
}