Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5444)

Unified Diff: chrome/browser/resources/gaia_auth_host/authenticator.js

Issue 892653002: Do not clear password field in authenticator in case emails mismatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698