OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Password confirmation screen implementation. | 6 * @fileoverview Password confirmation screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('ConfirmPasswordScreen', 'confirm-password', function() { | 9 login.createScreen('ConfirmPasswordScreen', 'confirm-password', function() { |
10 return { | 10 return { |
11 EXTERNAL_API: [ | 11 EXTERNAL_API: ['show'], |
12 'show' | |
13 ], | |
14 | 12 |
15 confirmPasswordForm_: null, | 13 confirmPasswordForm_: null, |
16 | 14 |
17 /** | 15 /** |
18 * Callback to run when the screen is dismissed. | 16 * Callback to run when the screen is dismissed. |
19 * @type {function(string)} | 17 * @type {function(string)} |
20 */ | 18 */ |
21 callback_: null, | 19 callback_: null, |
22 | 20 |
23 /** @override */ | 21 /** @override */ |
24 decorate: function() { | 22 decorate: function() { |
25 this.confirmPasswordForm_ = $('saml-confirm-password'); | 23 this.confirmPasswordForm_ = $('saml-confirm-password'); |
26 this.confirmPasswordForm_.addEventListener('cancel', function(e) { | 24 this.confirmPasswordForm_.addEventListener('cancel', function(e) { |
27 Oobe.showScreen({id: SCREEN_ACCOUNT_PICKER}); | 25 Oobe.showScreen({id: SCREEN_ACCOUNT_PICKER}); |
28 Oobe.resetSigninUI(true); | 26 Oobe.resetSigninUI(true); |
29 }); | 27 }); |
30 this.confirmPasswordForm_.addEventListener('passwordEnter', function(e) { | 28 this.confirmPasswordForm_.addEventListener('passwordEnter', function(e) { |
31 this.callback_(e.detail.password); | 29 this.callback_(e.detail.password); |
32 }.bind(this)); | 30 }.bind(this)); |
33 }, | 31 }, |
34 | 32 |
35 /** @override */ | 33 /** @override */ |
36 onBeforeShow: function(data) { | 34 onBeforeShow: function(data) { |
37 $('login-header-bar').signinUIState = | 35 $('login-header-bar').signinUIState = |
38 SIGNIN_UI_STATE.SAML_PASSWORD_CONFIRM; | 36 SIGNIN_UI_STATE.SAML_PASSWORD_CONFIRM; |
(...skipping 23 matching lines...) Expand all Loading... |
62 this.confirmPasswordForm_.reset(); | 60 this.confirmPasswordForm_.reset(); |
63 this.confirmPasswordForm_.email = email; | 61 this.confirmPasswordForm_.email = email; |
64 this.confirmPasswordForm_.manualInput = manualPasswordInput; | 62 this.confirmPasswordForm_.manualInput = manualPasswordInput; |
65 if (attemptCount > 0) | 63 if (attemptCount > 0) |
66 this.confirmPasswordForm_.invalidate(); | 64 this.confirmPasswordForm_.invalidate(); |
67 Oobe.showScreen({id: SCREEN_CONFIRM_PASSWORD}); | 65 Oobe.showScreen({id: SCREEN_CONFIRM_PASSWORD}); |
68 $('progress-dots').hidden = true; | 66 $('progress-dots').hidden = true; |
69 } | 67 } |
70 }; | 68 }; |
71 }); | 69 }); |
OLD | NEW |