Backed out changeset 01f50f0fbda6 (bug 1112552) for mass test bustage.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2014-12-18 15:52:49 -05:00
parent 0e5ac0e24e
commit d504a5595c

View File

@ -2,18 +2,18 @@
# 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");
let gFxAccounts = {
const PREF_SYNC_START_DOORHANGER = "services.sync.ui.showSyncStartDoorhanger";
const DOORHANGER_ACTIVATE_DELAY_MS = 5000;
const SYNC_MIGRATION_NOTIFICATION_TITLE = "fxa-migration";
PREF_SYNC_START_DOORHANGER: "services.sync.ui.showSyncStartDoorhanger",
DOORHANGER_ACTIVATE_DELAY_MS: 5000,
SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration",
let gFxAccounts = {
_initialized: false,
_inCustomizationMode: false,
@ -34,8 +34,8 @@ let gFxAccounts = {
"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
];
},
@ -108,8 +108,8 @@ let gFxAccounts = {
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();
@ -131,11 +131,11 @@ let gFxAccounts = {
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();
}
},
@ -155,7 +155,7 @@ let gFxAccounts = {
// 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();
@ -251,12 +251,12 @@ let gFxAccounts = {
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],
@ -270,7 +270,7 @@ let gFxAccounts = {
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") {
@ -280,7 +280,7 @@ let gFxAccounts = {
}
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");
@ -289,13 +289,13 @@ let gFxAccounts = {
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);
@ -306,14 +306,14 @@ let gFxAccounts = {
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);
}),
@ -328,7 +328,7 @@ let gFxAccounts = {
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