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

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

Issue 2082533002: Reland of Clear the login webview when SAML flow is canceled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid raising "ready" event too early due to redirection of an empty webview Created 4 years, 6 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 | « chrome/browser/resources/chromeos/login/screen_gaia_signin.js ('k') | 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 aa75f8aeac5095d25c773595cc267b35260dbe3e..f4e0e9376561e327964447683f5805aa2cfac39a 100644
--- a/chrome/browser/resources/gaia_auth_host/authenticator.js
+++ b/chrome/browser/resources/gaia_auth_host/authenticator.js
@@ -32,6 +32,7 @@ cr.define('cr.login', function() {
var SERVICE_ID = 'chromeoslogin';
var EMBEDDED_SETUP_CHROMEOS_ENDPOINT = 'embedded/setup/chromeos';
var SAML_REDIRECTION_PATH = 'samlredirect';
+ var BLANK_PAGE_URL = 'about:blank';
/**
* The source URL parameter for the constrained signin flow.
@@ -196,7 +197,7 @@ cr.define('cr.login', function() {
* Reinitializes authentication parameters so that a failed login attempt
* would not result in an infinite loop.
*/
- Authenticator.prototype.resetStates_ = function() {
+ Authenticator.prototype.resetStates = function() {
this.isLoaded_ = false;
this.email_ = null;
this.gaiaId_ = null;
@@ -216,13 +217,21 @@ cr.define('cr.login', function() {
};
/**
+ * Resets the webview to the blank page.
+ */
+ Authenticator.prototype.resetWebview = function() {
+ if (this.webview_.src && this.webview_.src != BLANK_PAGE_URL)
+ this.webview_.src = BLANK_PAGE_URL;
+ };
+
+ /**
* Loads the authenticator component with the given parameters.
* @param {AuthMode} authMode Authorization mode.
* @param {Object} data Parameters for the authorization flow.
*/
Authenticator.prototype.load = function(authMode, data) {
this.authMode = authMode;
- this.resetStates_();
+ this.resetStates();
// gaiaUrl parameter is used for testing. Once defined, it is never changed.
this.idpOrigin_ = data.gaiaUrl || IDP_ORIGIN;
this.continueUrl_ = data.continueUrl || CONTINUE_URL;
@@ -270,7 +279,7 @@ cr.define('cr.login', function() {
* Reloads the authenticator component.
*/
Authenticator.prototype.reload = function() {
- this.resetStates_();
+ this.resetStates();
this.webview_.src = this.reloadUrl_;
this.isLoaded_ = true;
};
@@ -703,7 +712,7 @@ cr.define('cr.login', function() {
gapsCookie: this.newGapsCookie_ || this.gapsCookie_ || '',
}
}));
- this.resetStates_();
+ this.resetStates();
};
/**
@@ -786,6 +795,8 @@ cr.define('cr.login', function() {
this.fireReadyEvent_();
// Focus webview after dispatching event when webview is already visible.
this.webview_.focus();
+ } else if (currentUrl == BLANK_PAGE_URL) {
+ this.fireReadyEvent_();
}
};
« no previous file with comments | « chrome/browser/resources/chromeos/login/screen_gaia_signin.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698