Chromium Code Reviews| Index: chrome/browser/resources/sync_setup_overlay.js |
| diff --git a/chrome/browser/resources/sync_setup_overlay.js b/chrome/browser/resources/sync_setup_overlay.js |
| index e35e72c377fe9c3681dde419749f89c77605cc08..7abdf8bfbed8fe6351acf2f53143b9b1e2f10bef 100644 |
| --- a/chrome/browser/resources/sync_setup_overlay.js |
| +++ b/chrome/browser/resources/sync_setup_overlay.js |
| @@ -4,6 +4,47 @@ |
| cr.exportPath('options'); |
| +/** @typedef {{appsEnforced: boolean, |
| + * appsRegistered: boolean, |
| + * appsSynced: boolean, |
| + * autofillEnforced: boolean, |
| + * autofillRegistered: boolean, |
| + * autofillSynced: boolean, |
| + * bookmarksEnforced: boolean, |
| + * bookmarksRegistered: boolean, |
| + * bookmarksSynced: boolean, |
| + * encryptAllData: boolean, |
| + * enterGooglePassphraseBody: (string|undefined), |
| + * enterPassphraseBody: (string|undefined), |
| + * extensionsEnforced: boolean, |
| + * extensionsRegistered: boolean, |
| + * extensionsSynced: boolean, |
| + * fullEncryptionBody: string, |
| + * isSupervised: boolean, |
| + * passphraseFailed: boolean, |
| + * passwordsEnforced: boolean, |
| + * passwordsRegistered: boolean, |
| + * passwordsSynced: boolean, |
| + * preferencesEnforced: boolean, |
| + * preferencesRegistered: boolean, |
| + * preferencesSynced: boolean, |
| + * showPassphrase: boolean, |
| + * showSyncEverythingPage: boolean, |
| + * syncAllDataTypes: boolean, |
| + * syncNothing: boolean, |
| + * tabsEnforced: boolean, |
| + * tabsRegistered: boolean, |
| + * tabsSynced: boolean, |
| + * themesEnforced: boolean, |
| + * themesRegistered: boolean, |
| + * themesSynced: boolean, |
| + * typedUrlsEnforced: boolean, |
| + * typedUrlsRegistered: boolean, |
| + * typedUrlsSynced: boolean, |
| + * usePassphrase: boolean}} |
| + */ |
| +var SyncArgs; |
|
Dan Beam
2014/09/11 02:53:09
nit: SyncConfig
Vitaly Pavlenko
2014/09/11 04:16:25
Done.
|
| + |
| /** |
| * The user's selection in the synced data type drop-down menu, as an index. |
| * @enum {number} |
| @@ -168,7 +209,7 @@ cr.define('options', function() { |
| * @private |
| */ |
| setDataTypeCheckboxesEnabled_: function(enabled) { |
| - for (dataType in dataTypeBoxesDisabled_) { |
| + for (var dataType in dataTypeBoxesDisabled_) { |
| $(dataType).disabled = !enabled || dataTypeBoxesDisabled_[dataType]; |
| } |
| }, |
| @@ -312,7 +353,7 @@ cr.define('options', function() { |
| * settings dialog. Also initializes |dataTypeBoxesChecked_| and |
| * |dataTypeBoxedDisabled_| with their values, and makes their onclick |
| * handlers update |dataTypeBoxesChecked_|. |
| - * @param {Object} args The configuration data used to show/hide UI. |
| + * @param {SyncArgs} args The configuration data used to show/hide UI. |
| * @private |
| */ |
| setChooseDataTypesCheckboxes_: function(args) { |
| @@ -406,6 +447,9 @@ cr.define('options', function() { |
| ['Options_SyncToggleDataType']); |
| }, |
| + /** |
| + * @param {SyncArgs} args |
| + */ |
| setEncryptionRadios_: function(args) { |
| if (!args.encryptAllData && !args.usePassphrase) { |
| $('basic-encryption-option').checked = true; |
| @@ -416,11 +460,17 @@ cr.define('options', function() { |
| } |
| }, |
| + /** |
| + * @param {SyncArgs} args |
| + */ |
| setCheckboxesAndErrors_: function(args) { |
| this.setChooseDataTypesCheckboxes_(args); |
| this.setEncryptionRadios_(args); |
| }, |
| + /** |
| + * @param {SyncArgs} args |
| + */ |
| showConfigure_: function(args) { |
| var datatypeSelect = $('sync-select-datatypes'); |
| var self = this; |
| @@ -556,7 +606,7 @@ cr.define('options', function() { |
| * Reveals the UI for entering a custom passphrase during initial setup. |
| * This happens if the user has previously enabled a custom passphrase on a |
| * different machine. |
| - * @param {Array} args The args that contain the passphrase UI |
| + * @param {SyncArgs} args The args that contain the passphrase UI |
| * configuration. |
| * @private |
| */ |
| @@ -595,6 +645,7 @@ cr.define('options', function() { |
| /** |
| * Displays the advanced sync setting dialog, and pre-selects either the |
| * "Sync everything" or the "Choose what to sync" drop-down menu item. |
| + * @param {SyncArgs} args |
| * @param {options.DataTypeSelection} index Index of item to pre-select. |
| * @private |
| */ |
| @@ -642,7 +693,7 @@ cr.define('options', function() { |
| /** |
| * Shows the appropriate sync setup page. |
| * @param {string} page A page of the sync setup to show. |
| - * @param {Object} args Data from the C++ to forward on to the right |
| + * @param {SyncArgs} args Data from the C++ to forward on to the right |
| * section. |
| */ |
| showSyncSetupPage_: function(page, args) { |