Bug 1297479 - create a pref to turn off UI to undo automatic migration for use by funnelcake builds, r?dolske draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 23 Aug 2016 19:30:32 +0100
changeset 404560 8df08a4648cd4432db3fd6ef2885672335cdc4ef
parent 404559 315763ca22c190dde2ef96f4f42e49fe63246106
child 405002 94f03c3e29b478b6f3bed16241c53b74a16e3373
push id27237
push usergijskruitbosch@gmail.com
push dateTue, 23 Aug 2016 18:31:11 +0000
reviewersdolske
bugs1297479
milestone51.0a1
Bug 1297479 - create a pref to turn off UI to undo automatic migration for use by funnelcake builds, r?dolske MozReview-Commit-ID: JZQuhMxxrXU
browser/app/profile/firefox.js
browser/components/migration/AutoMigrate.jsm
--- 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;
     }