Bug 962729 - Sync toolbar button and menu item need to open the prefs dialog when logged in r=markh
authorTim Taubert <ttaubert@mozilla.com>
Wed, 22 Jan 2014 20:53:58 +0100
changeset 165013 f5ac964a5264121e38e78733c74789076762dc42
parent 165012 720e5175441329135afc892cab91d6e45e79d437
child 165014 9cf4757cb559b919b7b91a14fe6be9557b8cbcbf
push id26070
push usercbook@mozilla.com
push dateFri, 24 Jan 2014 12:10:14 +0000
treeherdermozilla-central@1363da0cde92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs962729
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 962729 - Sync toolbar button and menu item need to open the prefs dialog when logged in r=markh
browser/base/content/browser-syncui.js
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -278,17 +278,23 @@ let gSyncUI = {
    *          "reset" -- reset sync
    */
 
   openSetup: function SUI_openSetup(wizardType) {
     let xps = Components.classes["@mozilla.org/weave/service;1"]
                                 .getService(Components.interfaces.nsISupports)
                                 .wrappedJSObject;
     if (xps.fxAccountsEnabled) {
-      switchToTabHavingURI("about:accounts", true);
+      fxAccounts.getSignedInUser().then(userData => {
+        if (userData) {
+          this.openPrefs();
+        } else {
+          switchToTabHavingURI("about:accounts", true);
+        }
+      });
     } else {
       let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
       if (win)
         win.focus();
       else {
         window.openDialog("chrome://browser/content/sync/setup.xul",
                           "weaveSetup", "centerscreen,chrome,resizable=no",
                           wizardType);