OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 (function() { | 5 (function() { |
6 | 6 |
7 /** | 7 /** |
8 * Names of the radio buttons which allow the user to choose their encryption | 8 * Names of the radio buttons which allow the user to choose their encryption |
9 * mechanism. | 9 * mechanism. |
10 * @enum {string} | 10 * @enum {string} |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // If autofill is not registered or synced, force Payments integration off. | 209 // If autofill is not registered or synced, force Payments integration off. |
210 if (!this.syncPrefs.autofillRegistered || !this.syncPrefs.autofillSynced) | 210 if (!this.syncPrefs.autofillRegistered || !this.syncPrefs.autofillSynced) |
211 this.set('syncPrefs.paymentsIntegrationEnabled', false); | 211 this.set('syncPrefs.paymentsIntegrationEnabled', false); |
212 | 212 |
213 // Hide the new passphrase box if the sync data has been encrypted. | 213 // Hide the new passphrase box if the sync data has been encrypted. |
214 if (this.syncPrefs.encryptAllData) | 214 if (this.syncPrefs.encryptAllData) |
215 this.creatingNewPassphrase_ = false; | 215 this.creatingNewPassphrase_ = false; |
216 | 216 |
217 // Focus the password input box if password is needed to start sync. | 217 // Focus the password input box if password is needed to start sync. |
218 if (this.syncPrefs.passphraseRequired) { | 218 if (this.syncPrefs.passphraseRequired) { |
219 // Async to allow the dom-if templates to render first. | 219 // Wait for the dom-if templates to render and subpage to become visible. |
220 this.async(function() { | 220 listenOnce(document, 'show-container', function() { |
221 var input = /** @type {!PaperInputElement} */ ( | 221 var input = /** @type {!PaperInputElement} */ ( |
222 this.$$('#existingPassphraseInput')); | 222 this.$$('#existingPassphraseInput')); |
223 input.inputElement.focus(); | 223 input.inputElement.focus(); |
224 }.bind(this)); | 224 }.bind(this)); |
225 } | 225 } |
226 }, | 226 }, |
227 | 227 |
228 /** | 228 /** |
229 * Handler for when the sync all data types checkbox is changed. | 229 * Handler for when the sync all data types checkbox is changed. |
230 * @param {!Event} event | 230 * @param {!Event} event |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 onLearnMoreTap_: function(event) { | 438 onLearnMoreTap_: function(event) { |
439 if (event.target.tagName == 'A') { | 439 if (event.target.tagName == 'A') { |
440 // Stop the propagation of events, so that clicking on links inside | 440 // Stop the propagation of events, so that clicking on links inside |
441 // checkboxes or radio buttons won't change the value. | 441 // checkboxes or radio buttons won't change the value. |
442 event.stopPropagation(); | 442 event.stopPropagation(); |
443 } | 443 } |
444 } | 444 } |
445 }); | 445 }); |
446 | 446 |
447 })(); | 447 })(); |
OLD | NEW |