Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/screen_gaia_signin.js |
| diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js |
| index 89e6671656c1e7f9258a06aed4b31464307b4673..ce0cd39a614f976c57e6d5a2f6470d590702c35d 100644 |
| --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js |
| +++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js |
| @@ -6,8 +6,6 @@ |
| * @fileoverview Oobe signin screen implementation. |
| */ |
| -<include src="../../gaia_auth_host/gaia_auth_host.js"> |
| - |
| login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| // Gaia loading time after which error message must be displayed and |
| // lazy portal check should be fired. |
| @@ -89,9 +87,48 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| */ |
| samlPasswordConfirmAttempt_: 0, |
| + /** |
| + * Whether we should show webview based signin. |
| + * @type {boolean} |
| + * @private |
| + */ |
| + isWebviewSignin: false, |
| + |
| /** @override */ |
| decorate: function() { |
| - this.gaiaAuthHost_ = new cr.login.GaiaAuthHost($('signin-frame')); |
| + this.isWebviewSignin = loadTimeData.getValue('isWebviewSignin'); |
| + if (this.isWebviewSignin) { |
| + /** |
| + * A listener class for authentication events from GaiaAuthHost. |
| + * @constructor |
| + * @implements {cr.login.GaiaAuthHost.Listener} |
| + */ |
| + function GaiaAuthHostListener(gaia_screen) { |
|
xiyuan
2014/12/26 23:06:02
Roger's recent CL is refactoring (https://coderevi
Dmitry Polukhin
2015/01/13 18:53:27
Done.
|
| + this.gaia_screen_ = gaia_screen; |
| + } |
| + |
| + /** @override */ |
| + GaiaAuthHostListener.prototype.onSuccess = function(credentials) { |
| + this.gaia_screen_.onAuthCompleted_(credentials); |
| + }; |
| + |
| + /** @override */ |
| + GaiaAuthHostListener.prototype.onReady = function(e) { |
| + this.gaia_screen_.onAuthReady_(); |
| + }; |
| + |
| + // Replace iframe with webview. |
| + var webview = this.ownerDocument.createElement('webview'); |
| + webview.id = 'signin-frame'; |
| + webview.name = 'signin-frame'; |
| + // TODO(dpolukhin): webview doesn't load page in hidden state, |
| + // use curtain instead. |
| + $('signin-frame').parentNode.replaceChild(webview, $('signin-frame')); |
| + this.gaiaAuthHost_ = new cr.login.GaiaAuthHost( |
| + webview, new GaiaAuthHostListener(this)); |
| + } else { |
| + this.gaiaAuthHost_ = new cr.login.GaiaAuthHost($('signin-frame')); |
| + } |
| this.gaiaAuthHost_.addEventListener( |
| 'ready', this.onAuthReady_.bind(this)); |
| this.gaiaAuthHost_.confirmPasswordCallback = |
| @@ -112,7 +149,6 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| e.preventDefault(); |
| }); |
| - |
| this.updateLocalizedContent(); |
| }, |
| @@ -148,7 +184,10 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| */ |
| showLoadingUI_: function(show) { |
| $('gaia-loading').hidden = !show; |
| - this.gaiaAuthHost_.frame.hidden = show; |
| + if (!this.isWebviewSignin) { |
| + // TODO(dpolukhin): proper implement curtain for webview signin. |
| + this.gaiaAuthHost_.frame.hidden = show; |
| + } |
| $('signin-right').hidden = show; |
| $('enterprise-info-container').hidden = show; |
| $('gaia-signin-divider').hidden = show; |