Index: chrome/browser/resources/chromeos/login/screen_confirm_password.js |
diff --git a/chrome/browser/resources/chromeos/login/screen_confirm_password.js b/chrome/browser/resources/chromeos/login/screen_confirm_password.js |
index 2ca191ff29654d5fca5fed16279f5fbff1d10345..2c287408a5e505a5ab8cf94924b86ad3ec3d1846 100644 |
--- a/chrome/browser/resources/chromeos/login/screen_confirm_password.js |
+++ b/chrome/browser/resources/chromeos/login/screen_confirm_password.js |
@@ -24,6 +24,14 @@ login.createScreen('ConfirmPasswordScreen', 'confirm-password', function() { |
'keydown', this.onPasswordFieldKeyDown_.bind(this)); |
$('confirm-password-confirm-button').addEventListener( |
'click', this.onConfirmPassword_.bind(this)); |
+ |
+ $('saml-confirm-password').addEventListener('cancel', function(e) { |
+ Oobe.showScreen({id: SCREEN_ACCOUNT_PICKER}); |
+ Oobe.resetSigninUI(true); |
+ }); |
+ $('saml-confirm-password').addEventListener('passwordEnter', function(e) { |
+ this.callback_(e.detail.password); |
+ }.bind(this)); |
}, |
get defaultControl() { |
@@ -36,6 +44,18 @@ login.createScreen('ConfirmPasswordScreen', 'confirm-password', function() { |
SIGNIN_UI_STATE.SAML_PASSWORD_CONFIRM; |
}, |
+ /** @override */ |
+ onAfterShow: function(data) { |
+ if (Oobe.isNewGaiaFlow()) |
+ $('saml-confirm-password').focus(); |
+ }, |
+ |
+ /** @override */ |
+ onBeforeHide: function() { |
+ if (Oobe.isNewGaiaFlow()) |
+ $('saml-confirm-password').reset(); |
+ }, |
+ |
/** |
* Handle 'keydown' event on password input field. |
*/ |
@@ -53,15 +73,25 @@ login.createScreen('ConfirmPasswordScreen', 'confirm-password', function() { |
/** |
* Shows the confirm password screen. |
+ * @param {string} email The authenticated user's e-mail. |
* @param {number} attemptCount Number of attempts tried, starting at 0. |
* @param {function(string)} callback The callback to be invoked when the |
* screen is dismissed. |
*/ |
- show: function(attemptCount, callback) { |
+ show: function(email, attemptCount, callback) { |
this.callback_ = callback; |
this.classList.toggle('error', attemptCount > 0); |
- |
- $('confirm-password-input').value = ''; |
+ if (Oobe.isNewGaiaFlow()) { |
+ $('saml-confirm-password-contents').hidden = true; |
+ var samlConfirmPassword = $('saml-confirm-password'); |
+ samlConfirmPassword.reset(); |
+ samlConfirmPassword.hidden = false; |
+ samlConfirmPassword.email = email; |
+ if (attemptCount > 0) |
+ samlConfirmPassword.invalidate(); |
+ } else { |
+ $('confirm-password-input').value = ''; |
+ } |
Oobe.showScreen({id: SCREEN_CONFIRM_PASSWORD}); |
$('progress-dots').hidden = true; |
} |