Chromium Code Reviews| Index: chrome/browser/resources/gaia_auth_host/authenticator.js |
| diff --git a/chrome/browser/resources/gaia_auth_host/authenticator.js b/chrome/browser/resources/gaia_auth_host/authenticator.js |
| index 3b9f0038430c521ccdfe24aee1b17ed563ec4357..f61a3515cc1cebc80488d8a2660a7e36c588cedd 100644 |
| --- a/chrome/browser/resources/gaia_auth_host/authenticator.js |
| +++ b/chrome/browser/resources/gaia_auth_host/authenticator.js |
| @@ -202,7 +202,7 @@ cr.define('cr.login', function() { |
| this.continueUrl_.substring(0, this.continueUrl_.indexOf('?')) || |
| this.continueUrl_; |
| this.isConstrainedWindow_ = data.constrained == '1'; |
| - this.isNewGaiaFlowChromeOS = data.isNewGaiaFlowChromeOS; |
| + this.isNewGaiaFlow = data.isNewGaiaFlow; |
| this.useEafe_ = data.useEafe || false; |
| this.clientId_ = data.clientId; |
| this.gapsCookie_ = data.gapsCookie; |
| @@ -217,7 +217,7 @@ cr.define('cr.login', function() { |
| this.idpOrigin_.indexOf('https://') == 0; |
| this.needPassword = !('needPassword' in data) || data.needPassword; |
| - if (this.isNewGaiaFlowChromeOS) { |
| + if (this.isNewGaiaFlow) { |
| this.webview_.contextMenus.onShow.addListener(function(e) { |
| e.preventDefault(); |
| }); |
| @@ -246,13 +246,13 @@ cr.define('cr.login', function() { |
| Authenticator.prototype.constructInitialFrameUrl_ = function(data) { |
| var path = data.gaiaPath; |
| - if (!path && this.isNewGaiaFlowChromeOS) |
| + if (!path && this.isNewGaiaFlow) |
| path = EMBEDDED_SETUP_CHROMEOS_ENDPOINT; |
| if (!path) |
| path = IDP_PATH; |
| var url = this.idpOrigin_ + path; |
| - if (this.isNewGaiaFlowChromeOS) { |
| + if (this.isNewGaiaFlow) { |
| if (data.chromeType) |
| url = appendParam(url, 'chrometype', data.chromeType); |
| if (data.clientId) |
| @@ -275,8 +275,13 @@ cr.define('cr.login', function() { |
| url = appendParam(url, 'hl', data.hl); |
| if (data.gaiaId) |
| url = appendParam(url, 'user_id', data.gaiaId); |
| - if (data.email) |
| - url = appendParam(url, 'Email', data.email); |
| + if (data.email) { |
| + if (data.readOnlyEmail) { |
| + url = appendParam(url, 'Email', data.email); |
|
anthonyvd
2015/09/15 18:13:47
nit: other params are all lower case, does this on
Roger Tawa OOO till Jul 10th
2015/09/16 19:27:29
Yes. This is specified by gaia. The parameter ne
|
| + } else { |
| + url = appendParam(url, 'email_hint', data.email); |
| + } |
| + } |
| if (this.isConstrainedWindow_) |
| url = appendParam(url, 'source', CONSTRAINED_FLOW_SOURCE); |
| if (data.flow) |
| @@ -391,7 +396,7 @@ cr.define('cr.login', function() { |
| var location = decodeURIComponent(header.value); |
| this.chooseWhatToSync_ = !!location.match(/(\?|&)source=3($|&)/); |
| } else if ( |
| - this.isNewGaiaFlowChromeOS && headerName == SET_COOKIE_HEADER) { |
| + this.isNewGaiaFlow && headerName == SET_COOKIE_HEADER) { |
| var headerValue = header.value; |
| if (headerValue.indexOf(OAUTH_CODE_COOKIE + '=', 0) == 0) { |
| this.oauthCode_ = |
| @@ -438,7 +443,7 @@ cr.define('cr.login', function() { |
| Authenticator.prototype.onBeforeSendHeaders_ = function(details) { |
| // We should re-send cookie if first request was unsuccessful (i.e. no new |
| // GAPS cookie was received). |
| - if (this.isNewGaiaFlowChromeOS && this.gapsCookie_ && |
| + if (this.isNewGaiaFlow && this.gapsCookie_ && |
| (!this.gapsCookieSent_ || !this.newGapsCookie_)) { |
| var headers = details.requestHeaders; |
| var found = false; |
| @@ -733,10 +738,8 @@ cr.define('cr.login', function() { |
| * @private |
| */ |
| Authenticator.prototype.onLoadCommit_ = function(e) { |
| - if (this.oauthCode_) { |
| - this.skipForNow_ = true; |
| + if (this.oauthCode_) |
| this.maybeCompleteAuth_(); |
| - } |
| }; |
| /** |