summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/login/screen_confirm_password.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/chromeos/login/screen_confirm_password.js')
-rw-r--r--chromium/chrome/browser/resources/chromeos/login/screen_confirm_password.js36
1 files changed, 33 insertions, 3 deletions
diff --git a/chromium/chrome/browser/resources/chromeos/login/screen_confirm_password.js b/chromium/chrome/browser/resources/chromeos/login/screen_confirm_password.js
index 2ca191ff296..2c287408a5e 100644
--- a/chromium/chrome/browser/resources/chromeos/login/screen_confirm_password.js
+++ b/chromium/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;
}