Bug 966123 - have sync prefs listen for the onverified observer and update accordingly. t=ttaubert.
authorMark Hammond <mhammond@skippinet.com.au>
Thu, 30 Jan 2014 20:07:49 -0800
changeset 182245 d9d7a18c14f367fad80e4223bcad699ff816eab1
parent 182244 08d8f9e97fdde7829db98382e174d790ea1412d8
child 182246 14d515084a878eb2adcc37f6b5db24412a859fd6
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)
bugs966123
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 966123 - have sync prefs listen for the onverified observer and update accordingly. t=ttaubert.
browser/components/preferences/sync.js
--- a/browser/components/preferences/sync.js
+++ b/browser/components/preferences/sync.js
@@ -1,15 +1,19 @@
 /* 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/. */
 
 Components.utils.import("resource://services-sync/main.js");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
+XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () {
+  return Components.utils.import("resource://gre/modules/FxAccountsCommon.js", {});
+});
+
 const PAGE_NO_ACCOUNT = 0;
 const PAGE_HAS_ACCOUNT = 1;
 const PAGE_NEEDS_UPDATE = 2;
 const PAGE_PLEASE_WAIT = 3;
 const FXA_PAGE_LOGGED_OUT = 4;
 const FXA_PAGE_LOGGED_IN = 5;
 
 // Indexes into the "login status" deck.
@@ -78,17 +82,18 @@ let gSyncPane = {
     xps.ensureLoaded();
   },
 
   _init: function () {
     let topics = ["weave:service:login:error",
                   "weave:service:login:finish",
                   "weave:service:start-over",
                   "weave:service:setup-complete",
-                  "weave:service:logout:finish"];
+                  "weave:service:logout:finish",
+                  FxAccountsCommon.ONVERIFIED_NOTIFICATION];
 
     // Add the observers now and remove them on unload
     //XXXzpao This should use Services.obs.* but Weave's Obs does nice handling
     //        of `this`. Fix in a followup. (bug 583347)
     topics.forEach(function (topic) {
       Weave.Svc.Obs.add(topic, this.updateWeavePrefs, this);
     }, this);
     window.addEventListener("unload", function() {