Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/resources/settings/people_page/sync_page.js

Issue 2941433002: MD Settings: fix auto-focus on sync page. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
dpapad 2017/06/13 01:27:34 s/wait/Wait
scottchen 2017/06/14 00:52:13 Done.
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
dpapad 2017/06/13 01:27:34 Remove new blank lines?
scottchen 2017/06/14 00:52:13 Done.
229
228 /** 230 /**
229 * Handler for when the sync all data types checkbox is changed. 231 * Handler for when the sync all data types checkbox is changed.
230 * @param {!Event} event 232 * @param {!Event} event
231 * @private 233 * @private
232 */ 234 */
233 onSyncAllDataTypesChanged_: function(event) { 235 onSyncAllDataTypesChanged_: function(event) {
234 if (event.target.checked) { 236 if (event.target.checked) {
235 this.set('syncPrefs.syncAllDataTypes', true); 237 this.set('syncPrefs.syncAllDataTypes', true);
236 238
237 // Cache the previously selected preference before checking every box. 239 // Cache the previously selected preference before checking every box.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 onLearnMoreTap_: function(event) { 440 onLearnMoreTap_: function(event) {
439 if (event.target.tagName == 'A') { 441 if (event.target.tagName == 'A') {
440 // Stop the propagation of events, so that clicking on links inside 442 // Stop the propagation of events, so that clicking on links inside
441 // checkboxes or radio buttons won't change the value. 443 // checkboxes or radio buttons won't change the value.
442 event.stopPropagation(); 444 event.stopPropagation();
443 } 445 }
444 } 446 }
445 }); 447 });
446 448
447 })(); 449 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698