| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 /** @override */ | 73 /** @override */ |
| 74 attached: function() { | 74 attached: function() { |
| 75 this.resetState_(); | 75 this.resetState_(); |
| 76 }, | 76 }, |
| 77 | 77 |
| 78 open: function() { | 78 open: function() { |
| 79 this.$.dialog.showModal(); | 79 this.$.dialog.showModal(); |
| 80 this.$.pinKeyboard.focus(); | 80 this.$.pinKeyboard.focus(); |
| 81 |
| 82 // Each tap of the PIN keyboard button transfers focus to the PIN input, |
| 83 // which will keep opening the virtual keyboard. Disable the virtual |
| 84 // keyboard while this dialog is present. |
| 85 chrome.send('SetForceDisableVirtualKeyboard', [true]); |
| 81 }, | 86 }, |
| 82 | 87 |
| 83 close: function() { | 88 close: function() { |
| 84 if (this.$.dialog.open) | 89 if (this.$.dialog.open) |
| 85 this.$.dialog.close(); | 90 this.$.dialog.close(); |
| 86 | 91 |
| 87 this.resetState_(); | 92 this.resetState_(); |
| 93 |
| 94 // Renable the virtual keyboard. |
| 95 chrome.send('SetForceDisableVirtualKeyboard', [false]); |
| 88 }, | 96 }, |
| 89 | 97 |
| 90 /** | 98 /** |
| 91 * Resets the element to the initial state. | 99 * Resets the element to the initial state. |
| 92 * @private | 100 * @private |
| 93 */ | 101 */ |
| 94 resetState_: function() { | 102 resetState_: function() { |
| 95 this.initialPin_ = ''; | 103 this.initialPin_ = ''; |
| 96 this.pinKeyboardValue_ = ''; | 104 this.pinKeyboardValue_ = ''; |
| 97 this.enableSubmit_ = false; | 105 this.enableSubmit_ = false; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 * @private | 260 * @private |
| 253 * @param {boolean} isConfirmStep | 261 * @param {boolean} isConfirmStep |
| 254 * @return {string} | 262 * @return {string} |
| 255 */ | 263 */ |
| 256 getContinueMessage_: function(isConfirmStep) { | 264 getContinueMessage_: function(isConfirmStep) { |
| 257 return this.i18n(isConfirmStep ? 'confirm' : 'configurePinContinueButton'); | 265 return this.i18n(isConfirmStep ? 'confirm' : 'configurePinContinueButton'); |
| 258 }, | 266 }, |
| 259 }); | 267 }); |
| 260 | 268 |
| 261 })(); | 269 })(); |
| OLD | NEW |