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

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: Update after review 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..cef63cd031c0d4ed8624e50b5122c1c23d556cf0 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) {
@@ -318,6 +312,18 @@ cr.define('cr.login', function() {
};
/**
+ * Invoked when a new document is loaded.
+ * @private
+ */
+ 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);
+ }
+ };
+
+ /**
* 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