Bug 1297479 - create a pref to turn off UI to undo automatic migration for use by funnelcake builds, r=Dolske

MozReview-Commit-ID: JZQuhMxxrXU

--HG--
extra : rebase_source : f796b9504e10aa0e19a57ea312ebe337dcdb1e1d
This commit is contained in:
Gijs Kruitbosch 2016-08-23 19:30:32 +01:00
parent 90610d7084
commit 40188f3de6
2 changed files with 4 additions and 1 deletions

View File

@ -1488,6 +1488,7 @@ 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);

View File

@ -9,6 +9,7 @@ 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";
@ -286,7 +287,8 @@ const AutoMigrate = {
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;
}