Backed out [Australis] changeset 7560f1dfaa97 (bug 965641)
authorTim Taubert <ttaubert@mozilla.com>
Thu, 30 Jan 2014 17:44:58 -0800
changeset 182233 ec4176c9caa6a7f9bfc674038817110fe1e95189
parent 182232 97b90c0dc96c317921b25eaf72edbb628a40ae95
child 182234 14dcf72485b54145e3c74d4ea51bd65e7f1f6702
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs965641
milestone29.0a1
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 [Australis] changeset 7560f1dfaa97 (bug 965641)
browser/base/content/browser-fxaccounts.js
browser/components/customizableui/content/panelUI.inc.xul
browser/locales/en-US/chrome/browser/browser.dtd
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -6,61 +6,56 @@ XPCOMUtils.defineLazyGetter(this, "FxAcc
   return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
 const PREF_SYNC_START_DOORHANGER = "services.sync.ui.showSyncStartDoorhanger";
 
 let gFxAccounts = {
 
   _initialized: false,
+  _originalLabel: null,
   _inCustomizationMode: false,
 
   get weave() {
     delete this.weave;
     return this.weave = Cc["@mozilla.org/weave/service;1"]
                           .getService(Ci.nsISupports)
                           .wrappedJSObject;
   },
 
   get topics() {
     delete this.topics;
     return this.topics = [
-      "weave:service:sync:start",
-      "weave:service:login:error",
       FxAccountsCommon.ONLOGIN_NOTIFICATION,
       FxAccountsCommon.ONVERIFIED_NOTIFICATION,
-      FxAccountsCommon.ONLOGOUT_NOTIFICATION
+      FxAccountsCommon.ONLOGOUT_NOTIFICATION,
+      "weave:service:sync:start"
     ];
   },
 
   get button() {
     delete this.button;
     return this.button = document.getElementById("PanelUI-fxa-status");
   },
 
-  get loginFailed() {
-    if (Weave.Status.login != Weave.LOGIN_SUCCEEDED) {
-      Weave.Service.verifyLogin();
-    }
-    return Weave.Service.identity.readyToAuthenticate &&
-           Weave.Status.login != Weave.LOGIN_SUCCEEDED;
-  },
-
   init: function () {
     if (this._initialized) {
       return;
     }
 
     for (let topic of this.topics) {
       Services.obs.addObserver(this, topic, false);
     }
 
     gNavToolbox.addEventListener("customizationstarting", this);
     gNavToolbox.addEventListener("customizationending", this);
 
+    // Save the button's original label so that
+    // we can restore it if overridden later.
+    this._originalLabel = this.button.getAttribute("label");
     this._initialized = true;
 
     this.updateUI();
   },
 
   uninit: function () {
     if (!this._initialized) {
       return;
@@ -136,37 +131,27 @@ let gFxAccounts = {
 
     // Make sure the button is disabled in customization mode.
     if (this._inCustomizationMode) {
       this.button.setAttribute("disabled", "true");
     } else {
       this.button.removeAttribute("disabled");
     }
 
-    let defaultLabel = this.button.getAttribute("defaultlabel");
-    let errorLabel = this.button.getAttribute("errorlabel");
-
     // If the user is signed into their Firefox account and we are not
     // currently in customization mode, show their email address.
     fxAccounts.getSignedInUser().then(userData => {
-      // Reset the button to its original state.
-      this.button.setAttribute("label", defaultLabel);
-      this.button.removeAttribute("tooltiptext");
-      this.button.removeAttribute("signedin");
-      this.button.removeAttribute("failed");
-
-      if (!this._inCustomizationMode) {
-        if (this.loginFailed) {
-          this.button.setAttribute("failed", "true");
-          this.button.setAttribute("label", errorLabel);
-        } else if (userData) {
-          this.button.setAttribute("signedin", "true");
-          this.button.setAttribute("label", userData.email);
-          this.button.setAttribute("tooltiptext", userData.email);
-        }
+      if (userData && !this._inCustomizationMode) {
+        this.button.setAttribute("signedin", "true");
+        this.button.setAttribute("label", userData.email);
+        this.button.setAttribute("tooltiptext", userData.email);
+      } else {
+        this.button.removeAttribute("signedin");
+        this.button.setAttribute("label", this._originalLabel);
+        this.button.removeAttribute("tooltiptext");
       }
     });
   },
 
   toggle: function (event) {
     if (event.originalTarget.hasAttribute("signedin")) {
       this.openPreferences();
     } else {
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -10,19 +10,17 @@
        noautofocus="true">
   <panelmultiview id="PanelUI-multiView" mainViewId="PanelUI-mainView">
     <panelview id="PanelUI-mainView" context="customizationPanelContextMenu">
       <vbox id="PanelUI-contents-scroller">
         <vbox id="PanelUI-contents" class="panelUI-grid"/>
       </vbox>
 
       <footer id="PanelUI-footer">
-        <toolbarbutton id="PanelUI-fxa-status"
-                       defaultlabel="&fxaSignIn.label;"
-                       errorlabel="&fxaSignInError.label;"
+        <toolbarbutton id="PanelUI-fxa-status" label="&fxaSignIn.label;"
                        oncommand="gFxAccounts.toggle(event);"
                        hidden="true"/>
 
         <hbox id="PanelUI-footer-inner">
           <toolbarbutton id="PanelUI-customize" label="&appMenuCustomize.label;"
                          exitLabel="&appMenuCustomizeExit.label;"
                          tooltiptext="&appMenuCustomize.tooltip;"
                          exitTooltiptext="&appMenuCustomizeExit.tooltip;"
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -92,17 +92,16 @@ These should match what Safari and other
 <!ENTITY exitFullScreenCmd.accesskey "F">
 <!ENTITY fullScreenCmd.label "Full Screen">
 <!ENTITY fullScreenCmd.accesskey "F">
 <!ENTITY fullScreenCmd.macCommandKey "f">
 <!ENTITY showAllTabsCmd.label "Show All Tabs">
 <!ENTITY showAllTabsCmd.accesskey "A">
 
 <!ENTITY fxaSignIn.label "Sign in to &syncBrand.shortName.label;">
-<!ENTITY fxaSignInError.label "Reconnect to &syncBrand.shortName.label;">
 <!ENTITY syncStartPanel.title "&brandShortName; is now syncing.">
 <!ENTITY syncStartPanel.subTitle "You can manage &syncBrand.shortName.label; in Options.">
 <!ENTITY syncStartPanel.subTitleUnix "You can manage &syncBrand.shortName.label; in Preferences.">
 <!ENTITY syncErrorPanel.title "Cannot connect to &syncBrand.shortName.label;">
 <!ENTITY syncErrorPanel.subTitle "Please sign in to resume syncing.">
 <!ENTITY syncErrorPanel.prefButton.label "Options">
 <!ENTITY syncErrorPanel.prefButton.accesskey "O">
 <!ENTITY syncErrorPanel.prefButtonUnix.label "Preferences">