| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.exportPath('options'); | 5 cr.exportPath('options'); |
| 6 | 6 |
| 7 /** @typedef {{appsEnforced: boolean, | 7 /** @typedef {{appsEnforced: boolean, |
| 8 * appsRegistered: boolean, | 8 * appsRegistered: boolean, |
| 9 * appsSynced: boolean, | 9 * appsSynced: boolean, |
| 10 * autofillEnforced: boolean, | 10 * autofillEnforced: boolean, |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 299 } |
| 300 | 300 |
| 301 // Don't allow the user to tweak the settings once we send the | 301 // Don't allow the user to tweak the settings once we send the |
| 302 // configuration to the backend. | 302 // configuration to the backend. |
| 303 this.setInputElementsDisabledState_(true); | 303 this.setInputElementsDisabledState_(true); |
| 304 $('use-default-link').hidden = true; | 304 $('use-default-link').hidden = true; |
| 305 $('use-default-link').disabled = true; | 305 $('use-default-link').disabled = true; |
| 306 $('use-default-link').onclick = null; | 306 $('use-default-link').onclick = null; |
| 307 | 307 |
| 308 // These values need to be kept in sync with where they are read in | 308 // These values need to be kept in sync with where they are read in |
| 309 // SyncSetupFlow::GetDataTypeChoiceData(). | 309 // sync_setup_handler.cc:GetConfiguration(). |
| 310 var syncAll = $('sync-select-datatypes').selectedIndex == | 310 var syncAll = $('sync-select-datatypes').selectedIndex == |
| 311 options.DataTypeSelection.SYNC_EVERYTHING; | 311 options.DataTypeSelection.SYNC_EVERYTHING; |
| 312 var syncNothing = $('sync-select-datatypes').selectedIndex == | 312 var syncNothing = $('sync-select-datatypes').selectedIndex == |
| 313 options.DataTypeSelection.SYNC_NOTHING; | 313 options.DataTypeSelection.SYNC_NOTHING; |
| 314 var result = JSON.stringify({ | 314 var result = JSON.stringify({ |
| 315 'syncAllDataTypes': syncAll, | 315 'syncAllDataTypes': syncAll, |
| 316 'syncNothing': syncNothing, | 316 'syncNothing': syncNothing, |
| 317 'bookmarksSynced': syncAll || $('bookmarks-checkbox').checked, | 317 'bookmarksSynced': syncAll || $('bookmarks-checkbox').checked, |
| 318 'preferencesSynced': syncAll || $('preferences-checkbox').checked, | 318 'preferencesSynced': syncAll || $('preferences-checkbox').checked, |
| 319 'themesSynced': syncAll || $('themes-checkbox').checked, | 319 'themesSynced': syncAll || $('themes-checkbox').checked, |
| 320 'passwordsSynced': syncAll || $('passwords-checkbox').checked, | 320 'passwordsSynced': syncAll || $('passwords-checkbox').checked, |
| 321 'autofillSynced': syncAll || $('autofill-checkbox').checked, | 321 'autofillSynced': syncAll || $('autofill-checkbox').checked, |
| 322 'extensionsSynced': syncAll || $('extensions-checkbox').checked, | 322 'extensionsSynced': syncAll || $('extensions-checkbox').checked, |
| 323 'typedUrlsSynced': syncAll || $('typed-urls-checkbox').checked, | 323 'typedUrlsSynced': syncAll || $('typed-urls-checkbox').checked, |
| 324 'appsSynced': syncAll || $('apps-checkbox').checked, | 324 'appsSynced': syncAll || $('apps-checkbox').checked, |
| 325 'tabsSynced': syncAll || $('tabs-checkbox').checked, | 325 'tabsSynced': syncAll || $('tabs-checkbox').checked, |
| 326 'wifiCredentialsSynced': syncAll || |
| 327 $('wifiCredentials-checkbox').checked, |
| 326 'encryptAllData': encryptAllData, | 328 'encryptAllData': encryptAllData, |
| 327 'usePassphrase': usePassphrase, | 329 'usePassphrase': usePassphrase, |
| 328 'isGooglePassphrase': googlePassphrase, | 330 'isGooglePassphrase': googlePassphrase, |
| 329 'passphrase': customPassphrase | 331 'passphrase': customPassphrase |
| 330 }); | 332 }); |
| 331 chrome.send('SyncSetupConfigure', [result]); | 333 chrome.send('SyncSetupConfigure', [result]); |
| 332 }, | 334 }, |
| 333 | 335 |
| 334 /** | 336 /** |
| 335 * Sets the disabled property of all input elements within the 'Customize | 337 * Sets the disabled property of all input elements within the 'Customize |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } | 434 } |
| 433 if (args.tabsRegistered) { | 435 if (args.tabsRegistered) { |
| 434 $('tabs-checkbox').checked = args.tabsSynced; | 436 $('tabs-checkbox').checked = args.tabsSynced; |
| 435 dataTypeBoxesChecked_['tabs-checkbox'] = args.tabsSynced; | 437 dataTypeBoxesChecked_['tabs-checkbox'] = args.tabsSynced; |
| 436 dataTypeBoxesDisabled_['tabs-checkbox'] = args.tabsEnforced; | 438 dataTypeBoxesDisabled_['tabs-checkbox'] = args.tabsEnforced; |
| 437 $('tabs-checkbox').onclick = this.handleDataTypeClick_; | 439 $('tabs-checkbox').onclick = this.handleDataTypeClick_; |
| 438 $('tabs-item').hidden = false; | 440 $('tabs-item').hidden = false; |
| 439 } else { | 441 } else { |
| 440 $('tabs-item').hidden = true; | 442 $('tabs-item').hidden = true; |
| 441 } | 443 } |
| 444 if (args.wifiCredentialsRegistered) { |
| 445 $('wifi-credentials-checkbox').checked = args.wifiCredentialsSynced; |
| 446 dataTypeBoxes_['wifi-credentials-checkbox'] = |
| 447 args.wifiCredentialsSynced; |
| 448 $('wifi-credentials-checkbox').onclick = this.handleDataTypeClick_; |
| 449 $('wifi-credentials-item').hidden = false; |
| 450 } else { |
| 451 $('wifi-credentials-item').hidden = true; |
| 452 } |
| 442 | 453 |
| 443 this.setDataTypeCheckboxes_(datatypeSelect.selectedIndex); | 454 this.setDataTypeCheckboxes_(datatypeSelect.selectedIndex); |
| 444 }, | 455 }, |
| 445 | 456 |
| 446 /** | 457 /** |
| 447 * Updates the cached values of the sync data type checkboxes stored in | 458 * Updates the cached values of the sync data type checkboxes stored in |
| 448 * |dataTypeBoxesChecked_|. Used as an onclick handler for each data type | 459 * |dataTypeBoxesChecked_|. Used as an onclick handler for each data type |
| 449 * checkbox. | 460 * checkbox. |
| 450 * @private | 461 * @private |
| 451 */ | 462 */ |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 878 |
| 868 SyncSetupOverlay.showStopSyncingUI = function() { | 879 SyncSetupOverlay.showStopSyncingUI = function() { |
| 869 SyncSetupOverlay.getInstance().showStopSyncingUI_(); | 880 SyncSetupOverlay.getInstance().showStopSyncingUI_(); |
| 870 }; | 881 }; |
| 871 | 882 |
| 872 // Export | 883 // Export |
| 873 return { | 884 return { |
| 874 SyncSetupOverlay: SyncSetupOverlay | 885 SyncSetupOverlay: SyncSetupOverlay |
| 875 }; | 886 }; |
| 876 }); | 887 }); |
| OLD | NEW |