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

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

Issue 995753002: Load webview based GAIA in hidden state and pass focus when ready (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 db85d62bb75a08eea9ed94f7238b52e0d3b7a81d..87f9c386141b030847f1b6e221a155830913563b 100644
--- a/chrome/browser/resources/gaia_auth_host/authenticator.js
+++ b/chrome/browser/resources/gaia_auth_host/authenticator.js
@@ -156,23 +156,6 @@ cr.define('cr.login', function() {
this.loaded_ = false;
};
- /**
- * Send message 'focusready' to Gaia so it sets focus on default input.
- */
- Authenticator.prototype.sendFocusReady = function() {
- var currentUrl = this.webview_.src;
- if (currentUrl.lastIndexOf(this.idpOrigin_) == 0) {
- var msg = {
- 'method': 'focusready'
- };
- // TODO(rsorokin): Get rid of this check once issue crbug.com/456118 is
- // fixed.
- if (this.webview_.contentWindow) {
- this.webview_.contentWindow.postMessage(msg, currentUrl);
- }
- }
- };
-
Authenticator.prototype.constructInitialFrameUrl_ = function(data) {
var url = this.idpOrigin_ + (data.gaiaPath || IDP_PATH);
@@ -393,8 +376,9 @@ cr.define('cr.login', function() {
Authenticator.prototype.onLoadStop_ = function(e) {
if (!this.loaded_) {
this.loaded_ = true;
- this.webview_.focus();
this.dispatchEvent(new Event('ready'));
+ // Focus webview after dispatching event when webview is already visible.
+ this.webview_.focus();
}
};

Powered by Google App Engine
This is Rietveld 408576698