Bug 967197 - "Create Account" and "Sign In" links in Sync preferences should go to separate pages r=markh
authorTim Taubert <ttaubert@mozilla.com>
Tue, 18 Feb 2014 12:05:13 +0100
changeset 169283 27959c18c6d252e9752aaea57c7aa628276e591a
parent 169282 4afd422ba0422182cd61437fee5d56fb46a925f7
child 169284 71fc055e0abe422ded78aea1246499977c744bc2
push id26243
push userryanvm@gmail.com
push dateTue, 18 Feb 2014 19:56:51 +0000
treeherdermozilla-central@267e8340c47a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs967197
milestone30.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 967197 - "Create Account" and "Sign In" links in Sync preferences should go to separate pages r=markh
browser/app/profile/firefox.js
browser/base/content/aboutaccounts/aboutaccounts.js
browser/components/preferences/sync.js
browser/components/preferences/sync.xul
services/fxaccounts/FxAccounts.jsm
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1366,15 +1366,18 @@ pref("browser.uiCustomization.state", ""
 // The URL where remote content that composes the UI for Firefox Accounts should
 // be fetched. Must use HTTPS.
 pref("identity.fxaccounts.remote.uri", "https://accounts.firefox.com/?service=sync&context=fx_desktop_v1");
 
 // The URL where remote content that forces re-authentication for Firefox Accounts
 // should be fetched.  Must use HTTPS.
 pref("identity.fxaccounts.remote.force_auth.uri", "https://accounts.firefox.com/force_auth?service=sync&context=fx_desktop_v1");
 
+// The remote content URL shown for signin in. Must use HTTPS.
+pref("identity.fxaccounts.remote.signin.uri", "https://accounts.firefox.com/signin?service=sync&context=fx_desktop_v1");
+
 // The URL we take the user to when they opt to "manage" their Firefox Account.
 // Note that this will always need to be in the same TLD as the
 // "identity.fxaccounts.remote.uri" pref.
 pref("identity.fxaccounts.settings.uri", "https://accounts.firefox.com/settings");
 
 // The URL of the Firefox Accounts auth server backend
 pref("identity.fxaccounts.auth.uri", "https://api.accounts.firefox.com/v1");
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -246,16 +246,19 @@ function getStarted() {
 
 function openPrefs() {
   window.openPreferences("paneSync");
 }
 
 function init() {
   if (window.location.href.contains("action=signin")) {
     show("remote");
+    wrapper.init(fxAccounts.getAccountsSignInURI());
+  } else if (window.location.href.contains("action=signup")) {
+    show("remote");
     wrapper.init();
   } else if (window.location.href.contains("action=reauth")) {
     fxAccounts.promiseAccountsForceSigninURI().then(url => {
       show("remote");
       wrapper.init(url);
     });
   } else {
     // Check if we have a local account
--- a/browser/components/preferences/sync.js
+++ b/browser/components/preferences/sync.js
@@ -251,16 +251,20 @@ let gSyncPane = {
       gSyncUtils._openLink(url);
       return;
     }
     win.switchToTabHavingURI(url, true);
     // seeing as we are doing this in a tab we close the prefs dialog.
     window.close();
   },
 
+  signUp: function() {
+    this.openContentInBrowser("about:accounts?action=signup");
+  },
+
   signIn: function() {
     this.openContentInBrowser("about:accounts?action=signin");
   },
 
   reSignIn: function() {
     this.openContentInBrowser("about:accounts?action=reauth");
   },
 
--- a/browser/components/preferences/sync.xul
+++ b/browser/components/preferences/sync.xul
@@ -183,17 +183,17 @@
           <spacer flex="1"/>
           <p>&determiningAcctStatus.label;</p>
           <spacer flex="1"/>
         </vbox>
 
         <vbox id="noFxaAccount">
           <description>&welcome.description;</description>
           <label class="text-link"
-                 onclick="gSyncPane.signIn(); return false;"
+                 onclick="gSyncPane.signUp(); return false;"
                  value="&welcome.createAccount.label;"/>
           <label class="text-link"
                  onclick="gSyncPane.signIn(); return false;"
                  value="&welcome.signIn.label;"/>
           <spacer flex="1"/>
           <label class="text-link"
                  onclick="gSyncPane.openOldSyncSupportPage(); return false;"
                  value="&welcome.useOldSync.label;"/>
--- a/services/fxaccounts/FxAccounts.jsm
+++ b/services/fxaccounts/FxAccounts.jsm
@@ -19,16 +19,17 @@ Cu.import("resource://gre/modules/FxAcco
 Cu.import("resource://gre/modules/FxAccountsCommon.js");
 Cu.import("resource://gre/modules/FxAccountsUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto",
   "resource://gre/modules/identity/jwcrypto.jsm");
 
 // All properties exposed by the public FxAccounts API.
 let publicProperties = [
+  "getAccountsSignInURI",
   "getAccountsURI",
   "getAssertion",
   "getKeys",
   "getSignedInUser",
   "loadAndPoll",
   "localtimeOffsetMsec",
   "now",
   "promiseAccountsForceSigninURI",
@@ -610,16 +611,25 @@ FxAccountsInternal.prototype = {
   getAccountsURI: function() {
     let url = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.uri");
     if (!/^https:/.test(url)) { // Comment to un-break emacs js-mode highlighting
       throw new Error("Firefox Accounts server must use HTTPS");
     }
     return url;
   },
 
+  // Return the URI of the remote UI flows.
+  getAccountsSignInURI: function() {
+    let url = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.signin.uri");
+    if (!/^https:/.test(url)) { // Comment to un-break emacs js-mode highlighting
+      throw new Error("Firefox Accounts server must use HTTPS");
+    }
+    return url;
+  },
+
   // Returns a promise that resolves with the URL to use to force a re-signin
   // of the current account.
   promiseAccountsForceSigninURI: function() {
     let url = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.force_auth.uri");
     if (!/^https:/.test(url)) { // Comment to un-break emacs js-mode highlighting
       throw new Error("Firefox Accounts server must use HTTPS");
     }
     // but we need to append the email address onto a query string.