Chromium Code Reviews| Index: chrome/browser/resources/options/sync_setup_overlay.js |
| diff --git a/chrome/browser/resources/options/sync_setup_overlay.js b/chrome/browser/resources/options/sync_setup_overlay.js |
| index d05b778599e20c3d7e88ecb5aa1577e3477f2b1d..b2eb9af070dd862d1cccf8a3a26961f957db1927 100644 |
| --- a/chrome/browser/resources/options/sync_setup_overlay.js |
| +++ b/chrome/browser/resources/options/sync_setup_overlay.js |
| @@ -25,6 +25,7 @@ cr.exportPath('options'); |
| * passwordsEnforced: boolean, |
| * passwordsRegistered: boolean, |
| * passwordsSynced: boolean, |
| + * paymentsIntegrationEnabled: boolean, |
| * preferencesEnforced: boolean, |
| * preferencesRegistered: boolean, |
| * preferencesSynced: boolean, |
| @@ -159,6 +160,10 @@ cr.define('options', function() { |
| $('use-default-link').onclick = function() { |
| self.showSyncEverythingPage_(); |
| }; |
| + $('autofill-checkbox').onclick = function() { |
| + self.paymentsIntegrationAvailableStateChanged_( |
| + $('autofill-checkbox').checked); |
| + }; |
| }, |
| /** @private */ |
| @@ -330,6 +335,7 @@ cr.define('options', function() { |
| options.DataTypeSelection.SYNC_EVERYTHING; |
| var syncNothing = $('sync-select-datatypes').selectedIndex == |
| options.DataTypeSelection.SYNC_NOTHING; |
| + var autofillSynced = syncAll || $('autofill-checkbox').checked; |
| var result = JSON.stringify({ |
| 'syncAllDataTypes': syncAll, |
| 'syncNothing': syncNothing, |
| @@ -337,13 +343,15 @@ cr.define('options', function() { |
| 'preferencesSynced': syncAll || $('preferences-checkbox').checked, |
| 'themesSynced': syncAll || $('themes-checkbox').checked, |
| 'passwordsSynced': syncAll || $('passwords-checkbox').checked, |
| - 'autofillSynced': syncAll || $('autofill-checkbox').checked, |
| + 'autofillSynced': autofillSynced, |
| 'extensionsSynced': syncAll || $('extensions-checkbox').checked, |
| 'typedUrlsSynced': syncAll || $('typed-urls-checkbox').checked, |
| 'appsSynced': syncAll || $('apps-checkbox').checked, |
| 'tabsSynced': syncAll || $('tabs-checkbox').checked, |
| - 'wifiCredentialsSynced': syncAll || |
| - $('wifi-credentials-checkbox').checked, |
| + 'wifiCredentialsSynced': |
| + syncAll || $('wifi-credentials-checkbox').checked, |
| + 'paymentsIntegrationEnabled': |
| + autofillSynced && $('payments-integration-checkbox').checked, |
| 'encryptAllData': encryptAllData, |
| 'usePassphrase': usePassphrase, |
| 'isGooglePassphrase': googlePassphrase, |
| @@ -421,8 +429,13 @@ cr.define('options', function() { |
| this.dataTypeBoxesDisabled_['autofill-checkbox'] = |
| args.autofillEnforced; |
| $('autofill-item').hidden = false; |
| + $('payments-integration-setting-area').hidden = false; |
| + $('payments-integration-checkbox').checked = |
| + args.autofillSynced && args.paymentsIntegrationEnabled; |
| + $('payments-integration-checkbox').disabled = !args.autofillSynced; |
| } else { |
| $('autofill-item').hidden = true; |
| + $('payments-integration-setting-area').hidden = true; |
| } |
| if (args.extensionsRegistered) { |
| $('extensions-checkbox').checked = args.extensionsSynced; |
| @@ -838,6 +851,17 @@ cr.define('options', function() { |
| doSignOutOnAuthError_: function() { |
| chrome.send('SyncSetupDoSignOutOnAuthError'); |
| }, |
| + |
| + /** |
| + * Toggles the visibility of the Payments integration checkbox. |
|
please use gerrit instead
2016/01/15 17:05:32
Would this wording be better?
s/visibility/enable
Justin Donnelly
2016/01/15 17:15:35
Oops, yeah, I copied this from the autofill settin
|
| + * @param {boolean} available Whether the user has the option of using |
| + * Payments data. |
| + * @private |
| + */ |
| + paymentsIntegrationAvailableStateChanged_: function(available) { |
| + $('payments-integration-checkbox').checked = available; |
| + $('payments-integration-checkbox').disabled = !available; |
| + }, |
| }; |
| // Forward public APIs to private implementations. |