Bug 1307382 - fix sync case for automigration undo telemetry, r=markh, a=sylvestre
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 04 Oct 2016 10:44:28 +0100
changeset 355960 02cc4b849623d4b28dc497ccc97cfbab9b951311
parent 355959 d1db21ca0e4e14236772b20ab86439ce72f71255
child 355961 1deca8f8c4967865fcf13c30a4a92abe9d64c4cb
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh, sylvestre
bugs1307382
milestone51.0a2
Bug 1307382 - fix sync case for automigration undo telemetry, r=markh, a=sylvestre MozReview-Commit-ID: GcJw83YnhN6
browser/components/migration/AutoMigrate.jsm
--- a/browser/components/migration/AutoMigrate.jsm
+++ b/browser/components/migration/AutoMigrate.jsm
@@ -82,17 +82,21 @@ const AutoMigrate = {
   },
 
   observe(subject, topic, data) {
     if (topic == kPasswordManagerTopic) {
       // As soon as any login gets added or modified, disable undo:
       // (Note that this ignores logins being removed as that doesn't
       //  impair the 'undo' functionality of the import.)
       if (kPasswordManagerTopicTypes.has(data)) {
-        this.removeUndoOption(this.UNDO_REMOVED_REASON_PASSWORD_CHANGE);
+        // Ignore chrome:// things like sync credentials:
+        let loginInfo = subject.QueryInterface(Ci.nsILoginInfo);
+        if (!loginInfo.hostname || !loginInfo.hostname.startsWith("chrome://")) {
+          this.removeUndoOption(this.UNDO_REMOVED_REASON_PASSWORD_CHANGE);
+        }
       }
     } else if (topic == kSyncTopic) {
       this.removeUndoOption(this.UNDO_REMOVED_REASON_SYNC_SIGNIN);
     }
   },
 
   /**
    * Automatically pick a migrator and resources to migrate,