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 ad4c84125c9317cda61d842ba59ec09e021d8e79..09ec20ad31c7962958cb10171bf1876837c8cf68 100644 |
| --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js |
| +++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js |
| @@ -28,7 +28,8 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| 'updateAuthExtension', |
| 'setAuthenticatedUserEmail', |
| 'doReload', |
| - 'onFrameError' |
| + 'onFrameError', |
| + 'updateCancelButtonState' |
| ], |
| /** |
| @@ -73,6 +74,13 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| cancelAllowed_: undefined, |
| /** |
| + * Whether we should user pods on the login screen. |
|
dzhioev (left Google)
2014/02/18 14:19:49
should show?
Nikita (slow)
2014/02/18 14:23:21
Done.
|
| + * @type {boolean} |
| + * @private |
| + */ |
| + isShowUsers_: undefined, |
| + |
| + /** |
| * SAML password confirmation attempt count. |
| * @type {number} |
| */ |
| @@ -297,9 +305,8 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| $('createManagedUserNoManagerText').textContent = |
| data.managedUsersRestrictionReason; |
| - // Allow cancellation of screen only when user pods can be displayed. |
| - this.cancelAllowed_ = data.isShowUsers && $('pod-row').pods.length; |
| - $('login-header-bar').allowCancel = this.cancelAllowed_; |
| + this.isShowUsers_ = data.isShowUsers; |
| + this.updateCancelButtonState(); |
| // Sign-in right panel is hidden if all of its items are hidden. |
| var noRightPanel = $('gaia-signin-reason').hidden && |
| @@ -322,6 +329,15 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| }, |
| /** |
| + * Updates [Cancel] button state. Allow cancellation of screen only when |
| + * user pods can be displayed. |
| + */ |
| + updateCancelButtonState: function() { |
| + this.cancelAllowed_ = this.isShowUsers_ && $('pod-row').pods.length; |
| + $('login-header-bar').allowCancel = this.cancelAllowed_; |
| + }, |
| + |
| + /** |
| * Whether the current auth flow is SAML. |
| */ |
| isSAML: function() { |