| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 }, | 196 }, |
| 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 } | 207 } |
| 207 } else { | 208 } else { |
| 208 // onPinSubmit_ gets called if the user hits enter on the PIN keyboard. | 209 // onPinSubmit_ gets called if the user hits enter on the PIN keyboard. |
| 209 // The PIN is not guaranteed to be valid in that case. | 210 // The PIN is not guaranteed to be valid in that case. |
| 210 if (!this.canSubmit_()) | 211 if (!this.canSubmit_()) |
| 211 return; | 212 return; |
| 212 | 213 |
| 213 function onSetModesCompleted(didSet) { | 214 function onSetModesCompleted(didSet) { |
| 214 if (!didSet) { | 215 if (!didSet) { |
| 215 console.error('Failed to update pin'); | 216 console.error('Failed to update pin'); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 * @private | 252 * @private |
| 252 * @param {boolean} isConfirmStep | 253 * @param {boolean} isConfirmStep |
| 253 * @return {string} | 254 * @return {string} |
| 254 */ | 255 */ |
| 255 getContinueMessage_: function(isConfirmStep) { | 256 getContinueMessage_: function(isConfirmStep) { |
| 256 return this.i18n(isConfirmStep ? 'confirm' : 'configurePinContinueButton'); | 257 return this.i18n(isConfirmStep ? 'confirm' : 'configurePinContinueButton'); |
| 257 }, | 258 }, |
| 258 }); | 259 }); |
| 259 | 260 |
| 260 })(); | 261 })(); |
| OLD | NEW |