From 6c91641271e536ffaa88a1dff5127e42ee99a91e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 25 Jan 2016 11:39:07 +0100 Subject: BASELINE: Update Chromium to 49.0.2623.23 Also adds missing printing sources. Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd Reviewed-by: Oswald Buddenhagen --- .../resources/gaia_auth_host/authenticator.js | 48 ++++++++++++++++------ 1 file changed, 35 insertions(+), 13 deletions(-) (limited to 'chromium/chrome/browser/resources/gaia_auth_host') diff --git a/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js b/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js index 64627402bb7..2407ffa3582 100644 --- a/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js +++ b/chromium/chrome/browser/resources/gaia_auth_host/authenticator.js @@ -68,7 +68,6 @@ cr.define('cr.login', function() { 'gaiaUrl', // Gaia url to use. 'gaiaPath', // Gaia path to use without a leading slash. 'hl', // Language code for the user interface. - 'email', // Pre-fill the email field in Gaia UI. 'service', // Name of Gaia service. 'continueUrl', // Continue url to use. 'frameUrl', // Initial frame URL to use. If empty defaults to @@ -85,11 +84,30 @@ cr.define('cr.login', function() { 'enterpriseDomain', // Domain in which hosting device is (or should be) // enrolled. 'emailDomain', // Value used to prefill domain for email. + 'chromeType', // Type of Chrome OS device, e.g. "chromebox". 'clientVersion', // Version of the Chrome build. 'platformVersion', // Version of the OS build. 'releaseChannel', // Installation channel. 'endpointGen', // Current endpoint generation. 'gapsCookie', // GAPS cookie + + // The email fields allow for the following possibilities: + // + // 1/ If 'email' is not supplied, then the email text field is blank and the + // user must type an email to proceed. + // + // 2/ If 'email' is supplied, and 'readOnlyEmail' is truthy, then the email + // is hardcoded and the user cannot change it. The user is asked for + // password. This is useful for re-auth scenarios, where chrome needs the + // user to authenticate for a specific account and only that account. + // + // 3/ If 'email' is supplied, and 'readOnlyEmail' is falsy, gaia will + // prefill the email text field using the given email address, but the user + // can still change it and then proceed. This is used on desktop when the + // user disconnects their profile then reconnects, to encourage them to use + // the same account. + 'email', + 'readOnlyEmail', ]; /** @@ -202,7 +220,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; @@ -218,7 +236,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(); }); @@ -247,13 +265,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) @@ -276,8 +294,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); + } else { + url = appendParam(url, 'email_hint', data.email); + } + } if (this.isConstrainedWindow_) url = appendParam(url, 'source', CONSTRAINED_FLOW_SOURCE); if (data.flow) @@ -294,7 +317,8 @@ cr.define('cr.login', function() { Authenticator.prototype.onRequestCompleted_ = function(details) { var currentUrl = details.url; - if (currentUrl.lastIndexOf(this.continueUrlWithoutParams_, 0) == 0) { + if (!this.isNewGaiaFlow && + currentUrl.lastIndexOf(this.continueUrlWithoutParams_, 0) == 0) { if (currentUrl.indexOf('ntp=1') >= 0) this.skipForNow_ = true; @@ -397,7 +421,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_ = @@ -444,7 +468,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; @@ -742,10 +766,8 @@ cr.define('cr.login', function() { * @private */ Authenticator.prototype.onLoadCommit_ = function(e) { - if (this.oauthCode_) { - this.skipForNow_ = true; + if (this.oauthCode_) this.maybeCompleteAuth_(); - } }; /** -- cgit v1.2.1