OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 const OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
7 | 7 |
8 // Variable to track if a captcha challenge was issued. If this gets set to | 8 // Variable to track if a captcha challenge was issued. If this gets set to |
9 // true, it stays that way until we are told about successful login from | 9 // true, it stays that way until we are told about successful login from |
10 // the browser. This means subsequent errors (like invalid password) are | 10 // the browser. This means subsequent errors (like invalid password) are |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
249 var result = JSON.stringify({ | 249 var result = JSON.stringify({ |
250 "keepEverythingSynced": syncAll, | 250 "keepEverythingSynced": syncAll, |
251 "syncBookmarks": syncAll || $('bookmarks-checkbox').checked, | 251 "syncBookmarks": syncAll || $('bookmarks-checkbox').checked, |
252 "syncPreferences": syncAll || $('preferences-checkbox').checked, | 252 "syncPreferences": syncAll || $('preferences-checkbox').checked, |
253 "syncThemes": syncAll || $('themes-checkbox').checked, | 253 "syncThemes": syncAll || $('themes-checkbox').checked, |
254 "syncPasswords": syncAll || $('passwords-checkbox').checked, | 254 "syncPasswords": syncAll || $('passwords-checkbox').checked, |
255 "syncAutofill": syncAll || $('autofill-checkbox').checked, | 255 "syncAutofill": syncAll || $('autofill-checkbox').checked, |
256 "syncExtensions": syncAll || $('extensions-checkbox').checked, | 256 "syncExtensions": syncAll || $('extensions-checkbox').checked, |
257 "syncTypedUrls": syncAll || $('typed-urls-checkbox').checked, | 257 "syncTypedUrls": syncAll || $('typed-urls-checkbox').checked, |
258 "syncApps": syncAll || $('apps-checkbox').checked, | 258 "syncApps": syncAll || $('apps-checkbox').checked, |
259 "syncSearchEngines": syncAll || $('search-engines-checkbox').checked, | |
259 "syncSessions": syncAll || $('sessions-checkbox').checked, | 260 "syncSessions": syncAll || $('sessions-checkbox').checked, |
260 "encryptAllData": encryptAllData, | 261 "encryptAllData": encryptAllData, |
261 "usePassphrase": usePassphrase, | 262 "usePassphrase": usePassphrase, |
262 "passphrase": customPassphrase | 263 "passphrase": customPassphrase |
263 }); | 264 }); |
264 chrome.send('SyncSetupConfigure', [result]); | 265 chrome.send('SyncSetupConfigure', [result]); |
265 }, | 266 }, |
266 | 267 |
267 /** | 268 /** |
268 * Sets the disabled property of all input elements within the 'Customize | 269 * Sets the disabled property of all input elements within the 'Customize |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 $('omnibox-item').className = "sync-item-show"; | 343 $('omnibox-item').className = "sync-item-show"; |
343 } else { | 344 } else { |
344 $('omnibox-item').className = "sync-item-hide"; | 345 $('omnibox-item').className = "sync-item-hide"; |
345 } | 346 } |
346 if (args.appsRegistered) { | 347 if (args.appsRegistered) { |
347 $('apps-checkbox').checked = args.syncApps; | 348 $('apps-checkbox').checked = args.syncApps; |
348 $('apps-item').className = "sync-item-show"; | 349 $('apps-item').className = "sync-item-show"; |
349 } else { | 350 } else { |
350 $('apps-item').className = "sync-item-hide"; | 351 $('apps-item').className = "sync-item-hide"; |
351 } | 352 } |
352 | 353 if (args.searchEnginesRegistered) { |
353 this.setCheckboxesToKeepEverythingSynced_(args.keepEverythingSynced); | 354 $('search-engines-checkbox').checked = args.syncSearchEngines; |
355 $('search-engines-item').className = "sync-item-show"; | |
arv (Not doing code reviews)
2011/08/26 17:52:56
sigh... these should be single quotes but it seems
| |
356 } else { | |
357 $('search-engines-item').className = "sync-item-hide"; | |
358 } | |
354 if (args.sessionsRegistered) { | 359 if (args.sessionsRegistered) { |
355 $('sessions-checkbox').checked = args.syncSessions; | 360 $('sessions-checkbox').checked = args.syncSessions; |
356 $('sessions-item').className = "sync-item-show"; | 361 $('sessions-item').className = "sync-item-show"; |
357 } else { | 362 } else { |
358 $('sessions-item').className = "sync-item-hide"; | 363 $('sessions-item').className = "sync-item-hide"; |
359 } | 364 } |
365 | |
366 this.setCheckboxesToKeepEverythingSynced_(args.keepEverythingSynced); | |
360 }, | 367 }, |
361 | 368 |
362 setEncryptionRadios_: function(args) { | 369 setEncryptionRadios_: function(args) { |
363 if (args['encryptAllData']) { | 370 if (args['encryptAllData']) { |
364 $('encrypt-all-option').checked = true; | 371 $('encrypt-all-option').checked = true; |
365 this.disableEncryptionRadioGroup_(); | 372 this.disableEncryptionRadioGroup_(); |
366 } else { | 373 } else { |
367 $('encrypt-sensitive-option').checked = true; | 374 $('encrypt-sensitive-option').checked = true; |
368 } | 375 } |
369 }, | 376 }, |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
808 | 815 |
809 SyncSetupOverlay.showStopSyncingUI = function() { | 816 SyncSetupOverlay.showStopSyncingUI = function() { |
810 SyncSetupOverlay.getInstance().showStopSyncingUI_(); | 817 SyncSetupOverlay.getInstance().showStopSyncingUI_(); |
811 }; | 818 }; |
812 | 819 |
813 // Export | 820 // Export |
814 return { | 821 return { |
815 SyncSetupOverlay: SyncSetupOverlay | 822 SyncSetupOverlay: SyncSetupOverlay |
816 }; | 823 }; |
817 }); | 824 }); |
OLD | NEW |