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 6492781c36c103aac1675b5e131f054451d7a216..7c74206b51aefaaf1e1af4a53811a186affb2449 100644 |
| --- a/chrome/browser/resources/gaia_auth_host/authenticator.js |
| +++ b/chrome/browser/resources/gaia_auth_host/authenticator.js |
| @@ -116,6 +116,8 @@ cr.define('cr.login', function() { |
| this.webview_.addEventListener( |
| 'newwindow', this.onNewWindow_.bind(this)); |
| this.webview_.addEventListener( |
| + 'contentload', this.onContentLoad_.bind(this)); |
| + this.webview_.addEventListener( |
| 'loadstop', this.onLoadStop_.bind(this)); |
| this.webview_.request.onCompleted.addListener( |
| this.onRequestCompleted_.bind(this), |
| @@ -196,9 +198,6 @@ cr.define('cr.login', function() { |
| this.updateHistoryState_(currentUrl); |
| - // Posts a message to IdP pages to initiate communication. |
| - if (currentUrl.lastIndexOf(this.idpOrigin_) == 0) |
| - this.webview_.contentWindow.postMessage({}, currentUrl); |
| }; |
| /** |
| @@ -254,12 +253,7 @@ cr.define('cr.login', function() { |
| signinDetails[pair[0].trim()] = pair[1].trim(); |
| }); |
| // Removes "" around. |
| - var email = signinDetails['email'].slice(1, -1); |
| - if (this.email_ != email) { |
| - this.email_ = email; |
| - // Clears the scraped password if the email has changed. |
| - this.password_ = null; |
| - } |
| + this.email_ = signinDetails['email'].slice(1, -1); |
| this.gaiaId_ = signinDetails['obfuscatedid'].slice(1, -1); |
| this.sessionIndex_ = signinDetails['sessionindex']; |
| } else if (headerName == SAML_HEADER) { |
| @@ -317,6 +311,13 @@ cr.define('cr.login', function() { |
| this.dispatchEvent(new CustomEvent('newWindow', {detail: e})); |
| }; |
| + Authenticator.prototype.onContentLoad_ = function(e) { |
| + // Posts a message to IdP pages to initiate communication. |
| + var currentUrl = this.webview_.src; |
| + if (currentUrl.lastIndexOf(this.idpOrigin_) == 0) { |
| + this.webview_.contentWindow.postMessage({}, currentUrl); |
| + } |
| + }; |
|
xiyuan
2015/01/30 18:19:51
nit: insert a blank line after
Roman Sorokin (ftl)
2015/02/02 08:55:54
Done.
|
| /** |
| * Invoked when the webview finishes loading a page. |
| * @private |