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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 if (!dialog.isConnected) { | 103 if (!dialog.isConnected) { |
104 setTimeout(this.open.bind(this)); | 104 setTimeout(this.open.bind(this)); |
105 return; | 105 return; |
106 } | 106 } |
107 | 107 |
108 if (this.$.dialog.open) | 108 if (this.$.dialog.open) |
109 return; | 109 return; |
110 | 110 |
111 this.writeUma_(LockScreenProgress.START_SCREEN_LOCK); | 111 this.writeUma_(LockScreenProgress.START_SCREEN_LOCK); |
112 this.$.dialog.showModal(); | 112 this.$.dialog.showModal(); |
| 113 this.async(function() { |
| 114 this.$.passwordInput.shadowRoot.querySelector('#input').focus(); |
| 115 }.bind(this)); |
113 }, | 116 }, |
114 | 117 |
115 /** @private */ | 118 /** @private */ |
116 onCancelTap_: function() { | 119 onCancelTap_: function() { |
117 if (this.$.dialog.open) | 120 if (this.$.dialog.open) |
118 this.$.dialog.close(); | 121 this.$.dialog.close(); |
119 }, | 122 }, |
120 | 123 |
121 /** | 124 /** |
122 * Called whenever the dialog is closed. | 125 * Called whenever the dialog is closed. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 this.quickUnlockPrivate_.getActiveModes(function(modes) { | 201 this.quickUnlockPrivate_.getActiveModes(function(modes) { |
199 var credentials = | 202 var credentials = |
200 /** @type {!Array<string>} */ (Array(modes.length).fill('')); | 203 /** @type {!Array<string>} */ (Array(modes.length).fill('')); |
201 this.quickUnlockPrivate_.setModes( | 204 this.quickUnlockPrivate_.setModes( |
202 this.password_, modes, credentials, onCheck); | 205 this.password_, modes, credentials, onCheck); |
203 }.bind(this)); | 206 }.bind(this)); |
204 } | 207 } |
205 }); | 208 }); |
206 | 209 |
207 })(); | 210 })(); |
OLD | NEW |