| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 | 6 * @fileoverview |
| 7 * | 7 * |
| 8 * 'settings-password-prompt-dialog' shows a dialog which asks for the user to | 8 * 'settings-password-prompt-dialog' shows a dialog which asks for the user to |
| 9 * enter their password. It validates the password is correct. Once the user has | 9 * enter their password. It validates the password is correct. Once the user has |
| 10 * entered their account password, the page fires an 'authenticated' event and | 10 * entered their account password, the page fires an 'authenticated' event and |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 }, | 119 }, |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Called whenever the dialog is closed. | 122 * Called whenever the dialog is closed. |
| 123 * @private | 123 * @private |
| 124 */ | 124 */ |
| 125 onClose_: function() { | 125 onClose_: function() { |
| 126 this.password_ = ''; | 126 this.password_ = ''; |
| 127 }, | 127 }, |
| 128 | 128 |
| 129 /** @private */ | |
| 130 onKeydown_: function(e) { | |
| 131 if (e.key == 'Enter') | |
| 132 this.submitPassword_(); | |
| 133 }, | |
| 134 | |
| 135 /** | 129 /** |
| 136 * Run the account password check. | 130 * Run the account password check. |
| 137 * @private | 131 * @private |
| 138 */ | 132 */ |
| 139 submitPassword_: function() { | 133 submitPassword_: function() { |
| 140 clearTimeout(this.clearAccountPasswordTimeout_); | 134 clearTimeout(this.clearAccountPasswordTimeout_); |
| 141 | 135 |
| 142 // The user might have started entering a password and then deleted it all. | 136 // The user might have started entering a password and then deleted it all. |
| 143 // Do not submit/show an error in this case. | 137 // Do not submit/show an error in this case. |
| 144 if (!this.password_) { | 138 if (!this.password_) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 this.quickUnlockPrivate_.getActiveModes(function(modes) { | 198 this.quickUnlockPrivate_.getActiveModes(function(modes) { |
| 205 var credentials = | 199 var credentials = |
| 206 /** @type {!Array<string>} */ (Array(modes.length).fill('')); | 200 /** @type {!Array<string>} */ (Array(modes.length).fill('')); |
| 207 this.quickUnlockPrivate_.setModes( | 201 this.quickUnlockPrivate_.setModes( |
| 208 this.password_, modes, credentials, onCheck); | 202 this.password_, modes, credentials, onCheck); |
| 209 }.bind(this)); | 203 }.bind(this)); |
| 210 } | 204 } |
| 211 }); | 205 }); |
| 212 | 206 |
| 213 })(); | 207 })(); |
| OLD | NEW |