Bug 963384 - [Australis] Don't show doorhanger when sync customization dialog will be shown r=markh
authorTim Taubert <ttaubert@mozilla.com>
Tue, 28 Jan 2014 18:54:01 -0800
changeset 181662 f91e0b1cc1481231cf41302901cdfcb1c83ef3d9
parent 181661 e52d5d4aa1a5b7a9400af5ddc149660466d3d045
child 181663 73ed67830408f08a84aae2c815771f8229085abb
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)
reviewersmarkh
bugs963384
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
Bug 963384 - [Australis] Don't show doorhanger when sync customization dialog will be shown r=markh
browser/base/content/browser-fxaccounts.js
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -28,16 +28,24 @@ let gFxAccounts = {
     ];
   },
 
   get button() {
     delete this.button;
     return this.button = document.getElementById("PanelUI-fxa-status");
   },
 
+  get syncNeedsCustomization() {
+    try {
+      return Services.prefs.getBoolPref("services.sync.needsCustomization");
+    } catch (e) {
+      return false;
+    }
+  },
+
   init: function () {
     if (this._initialized) {
       return;
     }
 
     for (let topic of this.topics) {
       Services.obs.addObserver(this, topic, false);
     }
@@ -61,20 +69,20 @@ let gFxAccounts = {
     for (let topic of this.topics) {
       Services.obs.removeObserver(this, topic);
     }
 
     this._initialized = false;
   },
 
   observe: function (subject, topic) {
-    if (topic == FxAccountsCommon.ONVERIFIED_NOTIFICATION) {
+    if (topic != FxAccountsCommon.ONVERIFIED_NOTIFICATION) {
+      this.updateUI();
+    } else if (!this.syncNeedsCustomization) {
       this.showDoorhanger();
-    } else {
-      this.updateUI();
     }
   },
 
   handleEvent: function (event) {
     this._inCustomizationMode = event.type == "customizationstarting";
     this.updateUI();
   },