| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 var result = JSON.stringify({ | 251 var result = JSON.stringify({ |
| 252 "keepEverythingSynced": syncAll, | 252 "keepEverythingSynced": syncAll, |
| 253 "syncBookmarks": syncAll || $('bookmarks-checkbox').checked, | 253 "syncBookmarks": syncAll || $('bookmarks-checkbox').checked, |
| 254 "syncPreferences": syncAll || $('preferences-checkbox').checked, | 254 "syncPreferences": syncAll || $('preferences-checkbox').checked, |
| 255 "syncThemes": syncAll || $('themes-checkbox').checked, | 255 "syncThemes": syncAll || $('themes-checkbox').checked, |
| 256 "syncPasswords": syncAll || $('passwords-checkbox').checked, | 256 "syncPasswords": syncAll || $('passwords-checkbox').checked, |
| 257 "syncAutofill": syncAll || $('autofill-checkbox').checked, | 257 "syncAutofill": syncAll || $('autofill-checkbox').checked, |
| 258 "syncExtensions": syncAll || $('extensions-checkbox').checked, | 258 "syncExtensions": syncAll || $('extensions-checkbox').checked, |
| 259 "syncTypedUrls": syncAll || $('typed-urls-checkbox').checked, | 259 "syncTypedUrls": syncAll || $('typed-urls-checkbox').checked, |
| 260 "syncApps": syncAll || $('apps-checkbox').checked, | 260 "syncApps": syncAll || $('apps-checkbox').checked, |
| 261 "syncSearchEngines": syncAll || $('search-engines-checkbox').checked, |
| 261 "syncSessions": syncAll || $('sessions-checkbox').checked, | 262 "syncSessions": syncAll || $('sessions-checkbox').checked, |
| 262 "encryptAllData": encryptAllData, | 263 "encryptAllData": encryptAllData, |
| 263 "usePassphrase": usePassphrase, | 264 "usePassphrase": usePassphrase, |
| 264 "passphrase": customPassphrase | 265 "passphrase": customPassphrase |
| 265 }); | 266 }); |
| 266 chrome.send('SyncSetupConfigure', [result]); | 267 chrome.send('SyncSetupConfigure', [result]); |
| 267 }, | 268 }, |
| 268 | 269 |
| 269 /** | 270 /** |
| 270 * Sets the disabled property of all input elements within the 'Customize | 271 * Sets the disabled property of all input elements within the 'Customize |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 $('omnibox-item').className = "sync-item-show"; | 345 $('omnibox-item').className = "sync-item-show"; |
| 345 } else { | 346 } else { |
| 346 $('omnibox-item').className = "sync-item-hide"; | 347 $('omnibox-item').className = "sync-item-hide"; |
| 347 } | 348 } |
| 348 if (args.appsRegistered) { | 349 if (args.appsRegistered) { |
| 349 $('apps-checkbox').checked = args.syncApps; | 350 $('apps-checkbox').checked = args.syncApps; |
| 350 $('apps-item').className = "sync-item-show"; | 351 $('apps-item').className = "sync-item-show"; |
| 351 } else { | 352 } else { |
| 352 $('apps-item').className = "sync-item-hide"; | 353 $('apps-item').className = "sync-item-hide"; |
| 353 } | 354 } |
| 354 | 355 if (args.searchEnginesRegistered) { |
| 355 this.setCheckboxesToKeepEverythingSynced_(args.keepEverythingSynced); | 356 $('search-engines-checkbox').checked = args.syncSearchEngines; |
| 357 $('search-engines-item').className = "sync-item-show"; |
| 358 } else { |
| 359 $('search-engines-item').className = "sync-item-hide"; |
| 360 } |
| 356 if (args.sessionsRegistered) { | 361 if (args.sessionsRegistered) { |
| 357 $('sessions-checkbox').checked = args.syncSessions; | 362 $('sessions-checkbox').checked = args.syncSessions; |
| 358 $('sessions-item').className = "sync-item-show"; | 363 $('sessions-item').className = "sync-item-show"; |
| 359 } else { | 364 } else { |
| 360 $('sessions-item').className = "sync-item-hide"; | 365 $('sessions-item').className = "sync-item-hide"; |
| 361 } | 366 } |
| 367 |
| 368 this.setCheckboxesToKeepEverythingSynced_(args.keepEverythingSynced); |
| 362 }, | 369 }, |
| 363 | 370 |
| 364 setEncryptionRadios_: function(args) { | 371 setEncryptionRadios_: function(args) { |
| 365 if (args['encryptAllData']) { | 372 if (args['encryptAllData']) { |
| 366 $('encrypt-all-option').checked = true; | 373 $('encrypt-all-option').checked = true; |
| 367 this.disableEncryptionRadioGroup_(); | 374 this.disableEncryptionRadioGroup_(); |
| 368 } else { | 375 } else { |
| 369 $('encrypt-sensitive-option').checked = true; | 376 $('encrypt-sensitive-option').checked = true; |
| 370 } | 377 } |
| 371 }, | 378 }, |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 | 817 |
| 811 SyncSetupOverlay.showStopSyncingUI = function() { | 818 SyncSetupOverlay.showStopSyncingUI = function() { |
| 812 SyncSetupOverlay.getInstance().showStopSyncingUI_(); | 819 SyncSetupOverlay.getInstance().showStopSyncingUI_(); |
| 813 }; | 820 }; |
| 814 | 821 |
| 815 // Export | 822 // Export |
| 816 return { | 823 return { |
| 817 SyncSetupOverlay: SyncSetupOverlay | 824 SyncSetupOverlay: SyncSetupOverlay |
| 818 }; | 825 }; |
| 819 }); | 826 }); |
| OLD | NEW |