Chromium Code Reviews| 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 * 'settings-setup-pin-dialog' is the settings page for choosing a PIN. | 7 * 'settings-setup-pin-dialog' is the settings page for choosing a PIN. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 | 197 |
| 198 /** @private */ | 198 /** @private */ |
| 199 onPinSubmit_: function() { | 199 onPinSubmit_: function() { |
| 200 if (!this.isConfirmStep_) { | 200 if (!this.isConfirmStep_) { |
| 201 if (this.isPinLongEnough_(this.pinKeyboardValue_)) { | 201 if (this.isPinLongEnough_(this.pinKeyboardValue_)) { |
| 202 this.initialPin_ = this.pinKeyboardValue_; | 202 this.initialPin_ = this.pinKeyboardValue_; |
| 203 this.pinKeyboardValue_ = ''; | 203 this.pinKeyboardValue_ = ''; |
| 204 this.isConfirmStep_ = true; | 204 this.isConfirmStep_ = true; |
| 205 this.onPinChange_(); | 205 this.onPinChange_(); |
| 206 this.$.pinKeyboard.focus(); | 206 this.$.pinKeyboard.focus(); |
| 207 recordLockScreenProgress(LockScreenProgress.ENTER_PIN); | |
| 207 } | 208 } |
| 208 } else { | 209 } else { |
| 209 // onPinSubmit_ gets called if the user hits enter on the PIN keyboard. | 210 // onPinSubmit_ gets called if the user hits enter on the PIN keyboard. |
| 210 // The PIN is not guaranteed to be valid in that case. | 211 // The PIN is not guaranteed to be valid in that case. |
| 211 if (!this.canSubmit_()) | 212 if (!this.canSubmit_()) |
| 212 return; | 213 return; |
| 213 | 214 |
| 214 function onSetModesCompleted(didSet) { | 215 function onSetModesCompleted(didSet) { |
| 215 if (!didSet) { | 216 if (!didSet) { |
| 216 console.error('Failed to update pin'); | 217 console.error('Failed to update pin'); |
| 217 return; | 218 return; |
| 218 } | 219 } |
| 219 | 220 |
| 220 this.resetState_(); | 221 this.resetState_(); |
| 221 this.fire('done'); | 222 this.fire('done'); |
| 222 } | 223 } |
| 223 | 224 |
| 224 this.setModes.call( | 225 this.setModes.call( |
| 225 null, | 226 null, |
| 226 [chrome.quickUnlockPrivate.QuickUnlockMode.PIN], | 227 [chrome.quickUnlockPrivate.QuickUnlockMode.PIN], |
| 227 [this.pinKeyboardValue_], | 228 [this.pinKeyboardValue_], |
| 228 onSetModesCompleted.bind(this)); | 229 onSetModesCompleted.bind(this)); |
| 230 recordLockScreenProgress(LockScreenProgress.CONFIRM_PIN); | |
|
jdufault
2016/09/13 19:36:35
Fix indentation
sammiequon
2016/09/13 21:34:58
Done.
| |
| 229 } | 231 } |
| 230 }, | 232 }, |
| 231 | 233 |
| 232 /** | 234 /** |
| 233 * @private | 235 * @private |
| 234 * @param {string} problemMessage | 236 * @param {string} problemMessage |
| 235 * @return {boolean} | 237 * @return {boolean} |
| 236 */ | 238 */ |
| 237 hasProblem_: function(problemMessage) { | 239 hasProblem_: function(problemMessage) { |
| 238 return !!problemMessage; | 240 return !!problemMessage; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 252 * @private | 254 * @private |
| 253 * @param {boolean} isConfirmStep | 255 * @param {boolean} isConfirmStep |
| 254 * @return {string} | 256 * @return {string} |
| 255 */ | 257 */ |
| 256 getContinueMessage_: function(isConfirmStep) { | 258 getContinueMessage_: function(isConfirmStep) { |
| 257 return this.i18n(isConfirmStep ? 'confirm' : 'configurePinContinueButton'); | 259 return this.i18n(isConfirmStep ? 'confirm' : 'configurePinContinueButton'); |
| 258 }, | 260 }, |
| 259 }); | 261 }); |
| 260 | 262 |
| 261 })(); | 263 })(); |
| OLD | NEW |