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 5692dc18a51db9f0aa9cdfa960b9449e02148ba1..2d121ca9a74d6eca399fb0903513519fe39f0ef9 100644 |
| --- a/chrome/browser/resources/gaia_auth_host/authenticator.js |
| +++ b/chrome/browser/resources/gaia_auth_host/authenticator.js |
| @@ -157,10 +157,21 @@ cr.define('cr.login', function() { |
| }; |
| /** |
| - * Set focus in Gaia on default input. |
| + * Send message 'focusready' to Gaia so it sets focus on default input. |
| */ |
| - Authenticator.prototype.setFocus = function() { |
| - this.onFocus_(); |
| + 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) { |
| + console.error('send message'); |
|
Nikita (slow)
2015/02/26 15:10:50
What is this error about? Please remove it.
Roman Sorokin (ftl)
2015/02/26 15:14:06
Oops, sorry. Done.
|
| + this.webview_.contentWindow.postMessage(msg, currentUrl); |
| + } |
| + } |
| }; |
| Authenticator.prototype.constructInitialFrameUrl_ = function(data) { |
| @@ -245,16 +256,6 @@ cr.define('cr.login', function() { |
| */ |
| Authenticator.prototype.onFocus_ = function(e) { |
| this.webview_.focus(); |
| - 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); |
| - } |
| }; |
| /** |