Backed out changeset 01f50f0fbda6 (bug 1112552) for mass test bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 18 Dec 2014 15:52:49 -0500
changeset 246210 e4c72ee3f315780df3829871ee039cfacf707373
parent 246209 a081d845627d3dbb053b6b46aa18ecc287ef18ad
child 246211 803bc910c45a875d9d76dc689c45dd91a1e02e23
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1112552
milestone37.0a1
backs out01f50f0fbda6913faa54628b7d8040b2c9a84503
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 01f50f0fbda6 (bug 1112552) for mass test bustage. CLOSED TREE
browser/base/content/browser-fxaccounts.js
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -1,25 +1,25 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function () {
+XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () {
   return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
-XPCOMUtils.defineLazyModuleGetter(gFxAccounts, "fxaMigrator",
+XPCOMUtils.defineLazyModuleGetter(this, "fxaMigrator",
   "resource://services-sync/FxaMigrator.jsm");
 
+const PREF_SYNC_START_DOORHANGER = "services.sync.ui.showSyncStartDoorhanger";
+const DOORHANGER_ACTIVATE_DELAY_MS = 5000;
+const SYNC_MIGRATION_NOTIFICATION_TITLE = "fxa-migration";
+
 let gFxAccounts = {
 
-  PREF_SYNC_START_DOORHANGER: "services.sync.ui.showSyncStartDoorhanger",
-  DOORHANGER_ACTIVATE_DELAY_MS: 5000,
-  SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration",
-
   _initialized: false,
   _inCustomizationMode: false,
 
   get weave() {
     delete this.weave;
     return this.weave = Cc["@mozilla.org/weave/service;1"]
                           .getService(Ci.nsISupports)
                           .wrappedJSObject;
@@ -29,18 +29,18 @@ let gFxAccounts = {
     // Do all this dance to lazy-load FxAccountsCommon.
     delete this.topics;
     return this.topics = [
       "weave:service:ready",
       "weave:service:sync:start",
       "weave:service:login:error",
       "weave:service:setup-complete",
       "fxa-migration:state-changed",
-      this.FxAccountsCommon.ONVERIFIED_NOTIFICATION,
-      this.FxAccountsCommon.ONLOGOUT_NOTIFICATION
+      FxAccountsCommon.ONVERIFIED_NOTIFICATION,
+      FxAccountsCommon.ONLOGOUT_NOTIFICATION
     ];
   },
 
   get button() {
     delete this.button;
     return this.button = document.getElementById("PanelUI-fxa-status");
   },
 
@@ -103,18 +103,18 @@ let gFxAccounts = {
       Services.obs.removeObserver(this, topic);
     }
 
     this._initialized = false;
   },
 
   observe: function (subject, topic, data) {
     switch (topic) {
-      case this.FxAccountsCommon.ONVERIFIED_NOTIFICATION:
-        Services.prefs.setBoolPref(this.PREF_SYNC_START_DOORHANGER, true);
+      case FxAccountsCommon.ONVERIFIED_NOTIFICATION:
+        Services.prefs.setBoolPref(PREF_SYNC_START_DOORHANGER, true);
         break;
       case "weave:service:sync:start":
         this.onSyncStart();
         break;
       case "fxa-migration:state-changed":
         this.onMigrationStateChanged(data, subject);
         break;
       default:
@@ -126,21 +126,21 @@ let gFxAccounts = {
   onSyncStart: function () {
     if (!this.isActiveWindow) {
       return;
     }
 
     let showDoorhanger = false;
 
     try {
-      showDoorhanger = Services.prefs.getBoolPref(this.PREF_SYNC_START_DOORHANGER);
+      showDoorhanger = Services.prefs.getBoolPref(PREF_SYNC_START_DOORHANGER);
     } catch (e) { /* The pref might not exist. */ }
 
     if (showDoorhanger) {
-      Services.prefs.clearUserPref(this.PREF_SYNC_START_DOORHANGER);
+      Services.prefs.clearUserPref(PREF_SYNC_START_DOORHANGER);
       this.showSyncStartedDoorhanger();
     }
   },
 
   onMigrationStateChanged: function (newState, email) {
     this._migrationInfo = !newState ? null : {
       state: newState,
       email: email ? email.QueryInterface(Ci.nsISupportsString).data : null,
@@ -150,17 +150,17 @@ let gFxAccounts = {
 
   handleEvent: function (event) {
     if (event.type == "activate") {
       // Our window might have been in the background while we received the
       // sync:start notification. If still needed, show the doorhanger after
       // a short delay. Without this delay the doorhanger would not show up
       // or with a too small delay show up while we're still animating the
       // window.
-      setTimeout(() => this.onSyncStart(), this.DOORHANGER_ACTIVATE_DELAY_MS);
+      setTimeout(() => this.onSyncStart(), DOORHANGER_ACTIVATE_DELAY_MS);
     } else {
       this._inCustomizationMode = event.type == "customizationstarting";
       this.updateAppMenuItem();
     }
   },
 
   showDoorhanger: function (id) {
     let panel = document.getElementById(id);
@@ -246,94 +246,94 @@ let gFxAccounts = {
       doUpdate(null);
     });
   },
 
   updateAppMenuItemForMigration: Task.async(function* () {
     let status = null;
     let label = null;
     switch (this._migrationInfo.state) {
-      case this.fxaMigrator.STATE_USER_FXA:
+      case fxaMigrator.STATE_USER_FXA:
         status = "migrate-signup";
         label = this.strings.formatStringFromName("needUserShort",
           [this.button.getAttribute("fxabrandname")], 1);
         break;
-      case this.fxaMigrator.STATE_USER_FXA_VERIFIED:
+      case fxaMigrator.STATE_USER_FXA_VERIFIED:
         status = "migrate-verify";
         label = this.strings.formatStringFromName("needVerifiedUserShort",
                                                   [this._migrationInfo.email],
                                                   1);
         break;
     }
     this.button.label = label;
     this.button.hidden = false;
     this.button.setAttribute("fxastatus", status);
   }),
 
   updateMigrationNotification: Task.async(function* () {
     if (!this._migrationInfo) {
-      Weave.Notifications.removeAll(this.SYNC_MIGRATION_NOTIFICATION_TITLE);
+      Weave.Notifications.removeAll(SYNC_MIGRATION_NOTIFICATION_TITLE);
       return;
     }
     if (gBrowser.currentURI.spec.split("?")[0] == "about:accounts") {
       // If the current tab is about:accounts, assume the user just completed a
       // migration step and don't bother them with a redundant notification.
       return;
     }
     let note = null;
     switch (this._migrationInfo.state) {
-      case this.fxaMigrator.STATE_USER_FXA: {
+      case fxaMigrator.STATE_USER_FXA: {
         let msg = this.strings.GetStringFromName("needUserLong");
         let upgradeLabel =
           this.strings.GetStringFromName("upgradeToFxA.label");
         let upgradeAccessKey =
           this.strings.GetStringFromName("upgradeToFxA.accessKey");
         note = new Weave.Notification(
           undefined, msg, undefined, Weave.Notifications.PRIORITY_WARNING, [
             new Weave.NotificationButton(upgradeLabel, upgradeAccessKey, () => {
-              this.fxaMigrator.createFxAccount(window);
+              fxaMigrator.createFxAccount(window);
             }),
           ]
         );
         break;
       }
-      case this.fxaMigrator.STATE_USER_FXA_VERIFIED: {
+      case fxaMigrator.STATE_USER_FXA_VERIFIED: {
         let msg =
           this.strings.formatStringFromName("needVerifiedUserLong",
                                             [this._migrationInfo.email], 1);
         let resendLabel =
           this.strings.GetStringFromName("resendVerificationEmail.label");
         let resendAccessKey =
           this.strings.GetStringFromName("resendVerificationEmail.accessKey");
         note = new Weave.Notification(
           undefined, msg, undefined, Weave.Notifications.PRIORITY_INFO, [
             new Weave.NotificationButton(resendLabel, resendAccessKey, () => {
-              this.fxaMigrator.resendVerificationMail();
+              fxaMigrator.resendVerificationMail();
             }),
           ]
         );
         break;
       }
     }
-    note.title = this.SYNC_MIGRATION_NOTIFICATION_TITLE;
+    note.title = SYNC_MIGRATION_NOTIFICATION_TITLE;
     Weave.Notifications.replaceTitle(note);
   }),
 
   onMenuPanelCommand: function (event) {
     let button = event.originalTarget;
 
     switch (button.getAttribute("fxastatus")) {
     case "signedin":
       this.openPreferences();
       break;
     case "error":
       this.openSignInAgainPage("menupanel");
       break;
     case "migrate-signup":
-      this.fxaMigrator.createFxAccount(window);
+      fxaMigrator.createFxAccount(window);
       break;
     case "migrate-verify":
       // Instead of using the migrator module directly here the UX calls for
       // us to open prefs which has a "resend" button.
       this.openPreferences();
       break;
     default:
       this.openAccountsPage(null, { entryPoint: "menupanel" });