Bug 1353571 part 2 - Remove unused customization mode code for the FxA status bar. r?markh draft
authorEdouard Oger <eoger@fastmail.com>
Fri, 14 Apr 2017 17:59:59 -0700
changeset 572164 f9fe9ef116ec7f42ab950fa2c0b9ca4d23d46d1e
parent 572163 67b61b648996540c08fb45d6ca29eb7a33600ac0
child 572165 8fe0dde19cead8304d306ca78a506f719f435332
push id57011
push userbmo:eoger@fastmail.com
push dateWed, 03 May 2017 21:00:43 +0000
reviewersmarkh
bugs1353571
milestone55.0a1
Bug 1353571 part 2 - Remove unused customization mode code for the FxA status bar. r?markh MozReview-Commit-ID: J7Nz93MG7yh
browser/base/content/browser-fxaccounts.js
browser/themes/shared/customizableui/panelUI.inc.css
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -1,16 +1,15 @@
 /* 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/. */
 
 var gFxAccounts = {
 
   _initialized: false,
-  _inCustomizationMode: false,
   _cachedProfile: null,
 
   get weave() {
     delete this.weave;
     return this.weave = Cc["@mozilla.org/weave/service;1"]
                           .getService(Ci.nsISupports)
                           .wrappedJSObject;
   },
@@ -110,19 +109,16 @@ var gFxAccounts = {
     if (this._initialized || !window.toolbar.visible) {
       return;
     }
 
     for (let topic of this.topics) {
       Services.obs.addObserver(this, topic);
     }
 
-    gNavToolbox.addEventListener("customizationstarting", this);
-    gNavToolbox.addEventListener("customizationending", this);
-
     EnsureFxAccountsWebChannel();
     this._initialized = true;
 
     this.updateUI();
   },
 
   uninit() {
     if (!this._initialized) {
@@ -142,38 +138,20 @@ var gFxAccounts = {
         this._cachedProfile = null;
         // Fallthrough intended
       default:
         this.updateUI();
         break;
     }
   },
 
-  handleEvent(event) {
-    this._inCustomizationMode = event.type == "customizationstarting";
-    this.updateUI();
-  },
-
   // Note that updateUI() returns a Promise that's only used by tests.
   updateUI() {
     this.panelUIFooter.hidden = false;
 
-    // Make sure the button is disabled in customization mode.
-    if (this._inCustomizationMode) {
-      this.panelUIStatus.setAttribute("disabled", "true");
-      this.panelUILabel.setAttribute("disabled", "true");
-      this.panelUIAvatar.setAttribute("disabled", "true");
-      this.panelUIIcon.setAttribute("disabled", "true");
-    } else {
-      this.panelUIStatus.removeAttribute("disabled");
-      this.panelUILabel.removeAttribute("disabled");
-      this.panelUIAvatar.removeAttribute("disabled");
-      this.panelUIIcon.removeAttribute("disabled");
-    }
-
     let defaultLabel = this.panelUIStatus.getAttribute("defaultlabel");
     let errorLabel = this.panelUIStatus.getAttribute("errorlabel");
     let unverifiedLabel = this.panelUIStatus.getAttribute("unverifiedlabel");
     // The localization string is for the signed in text, but it's the default text as well
     let defaultTooltiptext = this.panelUIStatus.getAttribute("signedinTooltiptext");
 
     let updateWithUserData = (userData) => {
       // Window might have been closed while fetching data.
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -849,17 +849,17 @@ toolbarpaletteitem[place="palette"] > to
 #PanelUI-remotetabs-deck:not([selectedIndex="3"]) > #PanelUI-remotetabs-nodevicespane {
   visibility: collapse;
 }
 
 #PanelUI-remotetabs-main[devices-status="single"] > #PanelUI-remotetabs-buttons {
   display: none;
 }
 
-#PanelUI-fxa-icon[syncstatus="active"]:not([disabled]) {
+#PanelUI-fxa-icon[syncstatus="active"] {
   list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar.png);
 }
 
 #PanelUI-customize {
   list-style-image: url(chrome://browser/skin/menuPanel-customize.png);
 }
 
 #customization-panelHolder #PanelUI-customize {
@@ -884,21 +884,16 @@ toolbarpaletteitem[place="palette"] > to
   -moz-image-region: rect(0, 16px, 16px, 0);
 }
 
 #PanelUI-footer-fxa[fxastatus="signedin"] > #PanelUI-fxa-status > #PanelUI-fxa-label > .toolbarbutton-icon,
 #PanelUI-footer-fxa:not([fxastatus="signedin"]) > #PanelUI-fxa-status > #PanelUI-fxa-avatar {
   display: none;
 }
 
-#PanelUI-fxa-status[disabled],
-#PanelUI-fxa-icon[disabled] {
-  pointer-events: none;
-}
-
 #PanelUI-fxa-avatar {
   width: 32px;
   height: 32px;
   border-radius: 50%;
   background-repeat: no-repeat;
   background-position: 0 0;
   background-size: contain;
   align-self: center;
@@ -924,47 +919,43 @@ toolbarpaletteitem[place="palette"] > to
   -moz-image-region: rect(0, 48px, 16px, 32px);
 }
 
 #PanelUI-help[panel-multiview-anchor="true"] {
   -moz-image-region: rect(0, 64px, 16px, 48px);
 }
 
 #PanelUI-help[disabled],
-#PanelUI-quit[disabled],
-#PanelUI-fxa-icon[disabled],
-#PanelUI-fxa-avatar[disabled],
-#PanelUI-fxa-label[disabled] > .toolbarbutton-icon,
-#PanelUI-fxa-status::after {
+#PanelUI-quit[disabled] {
   opacity: 0.4;
 }
 
-#PanelUI-fxa-status:not([disabled]):hover,
-#PanelUI-fxa-icon:not([disabled]):hover,
+#PanelUI-fxa-status:hover,
+#PanelUI-fxa-icon:hover,
 #PanelUI-help:not([disabled]):hover,
 #PanelUI-customize:hover,
 #PanelUI-quit:not([disabled]):hover {
   outline: 1px solid var(--arrowpanel-dimmed);
   background-color: var(--arrowpanel-dimmed);
 }
 
-#PanelUI-fxa-status:not([disabled]):hover:active,
-#PanelUI-fxa-icon:not([disabled]):hover:active,
+#PanelUI-fxa-status:hover:active,
+#PanelUI-fxa-icon:hover:active,
 #PanelUI-help:not([disabled]):hover:active,
 #PanelUI-customize:hover:active,
 #PanelUI-quit:not([disabled]):hover:active {
   outline: 1px solid var(--arrowpanel-dimmed-further);
   background-color: var(--arrowpanel-dimmed-further);
   box-shadow: 0 1px 0 hsla(210,4%,10%,.05) inset;
 }
 
-#PanelUI-fxa-status:not([disabled]):hover,
-#PanelUI-fxa-status:not([disabled]):hover:active,
-#PanelUI-fxa-icon:not([disabled]):hover,
-#PanelUI-fxa-icon:not([disabled]):hover:active {
+#PanelUI-fxa-status:hover,
+#PanelUI-fxa-status:hover:active,
+#PanelUI-fxa-icon:hover,
+#PanelUI-fxa-icon:hover:active {
   outline: none;
 }
 
 #PanelUI-footer-fxa[fxastatus="error"] {
   background-color: hsl(42,94%,88%);
   border-top: 1px solid hsl(42,94%,70%);
 }
 
@@ -1708,17 +1699,17 @@ menuitem[checked="true"].subviewbutton >
     list-style-image: url(chrome://branding/content/icon32.png);
   }
 
   #PanelUI-fxa-label,
   #PanelUI-fxa-icon {
     list-style-image: url(chrome://browser/skin/sync-horizontalbar@2x.png);
   }
 
-  #PanelUI-fxa-icon[syncstatus="active"]:not([disabled]) {
+  #PanelUI-fxa-icon[syncstatus="active"] {
     list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar@2x.png);
   }
 
   #PanelUI-customize {
     list-style-image: url(chrome://browser/skin/menuPanel-customize@2x.png);
   }
 
   #customization-panelHolder #PanelUI-customize {