| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // Reset the password so that any cached references to this.setModes | 150 // Reset the password so that any cached references to this.setModes |
| 151 // will fail. | 151 // will fail. |
| 152 password = ''; | 152 password = ''; |
| 153 this.setModes = null; | 153 this.setModes = null; |
| 154 } | 154 } |
| 155 | 155 |
| 156 this.clearAccountPasswordTimeout_ = setTimeout( | 156 this.clearAccountPasswordTimeout_ = setTimeout( |
| 157 clearSetModes.bind(this), PASSWORD_ACTIVE_DURATION_MS); | 157 clearSetModes.bind(this), PASSWORD_ACTIVE_DURATION_MS); |
| 158 // Closing the dialog will clear this.password_. | 158 // Closing the dialog will clear this.password_. |
| 159 this.$.dialog.close(); | 159 this.$.dialog.close(); |
| 160 chrome.send('metricsHandler:recordInHistogram', |
| 161 [PinUnlockUmaHistogramName, |
| 162 PinUnlockSetupType.ENTER_PASSWORD_CORRECTLY, |
| 163 PinUnlockSetupType.MAX_BUCKET]); |
| 160 } | 164 } |
| 161 } | 165 } |
| 162 | 166 |
| 163 checkAccountPassword_(this.password_, onPasswordChecked.bind(this)); | 167 checkAccountPassword_(this.password_, onPasswordChecked.bind(this)); |
| 164 }, | 168 }, |
| 165 | 169 |
| 166 /** @private */ | 170 /** @private */ |
| 167 onPasswordChanged_: function() { | 171 onPasswordChanged_: function() { |
| 168 this.passwordInvalid_ = false; | 172 this.passwordInvalid_ = false; |
| 169 }, | 173 }, |
| 170 | 174 |
| 171 /** @private */ | 175 /** @private */ |
| 172 enableConfirm_: function() { | 176 enableConfirm_: function() { |
| 173 return !!this.password_ && !this.passwordInvalid_; | 177 return !!this.password_ && !this.passwordInvalid_; |
| 174 } | 178 } |
| 175 }); | 179 }); |
| 176 | 180 |
| 177 })(); | 181 })(); |
| OLD | NEW |