| Index: chrome/browser/resources/settings/people_page/sync_page.js
|
| diff --git a/chrome/browser/resources/settings/people_page/sync_page.js b/chrome/browser/resources/settings/people_page/sync_page.js
|
| index f2f031f07e17d1a548ec01e75770e4e63697bd85..c50b263903c447012519667dfd7d8f6da42fe7ef 100644
|
| --- a/chrome/browser/resources/settings/people_page/sync_page.js
|
| +++ b/chrome/browser/resources/settings/people_page/sync_page.js
|
| @@ -173,6 +173,10 @@ Polymer({
|
| this.syncPrefs = syncPrefs;
|
| this.selectedPage_ = settings.PageStatus.CONFIGURE;
|
|
|
| + // If autofill is not registered or synced, force Payments integration off.
|
| + if (!this.syncPrefs.autofillRegistered || !this.syncPrefs.autofillSynced)
|
| + this.set('syncPrefs.paymentsIntegrationEnabled', false);
|
| +
|
| // Hide the new passphrase box if the sync data has been encrypted.
|
| if (this.syncPrefs.encryptAllData)
|
| this.creatingNewPassphrase_ = false;
|
| @@ -195,13 +199,14 @@ Polymer({
|
| this.set('syncPrefs.bookmarksSynced', true);
|
| this.set('syncPrefs.passwordsSynced', true);
|
| this.set('syncPrefs.tabsSynced', true);
|
| + this.set('syncPrefs.paymentsIntegrationEnabled', true);
|
| }
|
|
|
| this.onSingleSyncDataTypeChanged_();
|
| },
|
|
|
| /**
|
| - * Handler for when any sync data type checkbox is changed.
|
| + * Handler for when any sync data type checkbox is changed (except autofill).
|
| * @private
|
| */
|
| onSingleSyncDataTypeChanged_: function() {
|
| @@ -215,6 +220,17 @@ Polymer({
|
| },
|
|
|
| /**
|
| + * Handler for when the autofill data type checkbox is changed.
|
| + * @private
|
| + */
|
| + onAutofillDataTypeChanged_: function() {
|
| + this.set('syncPrefs.paymentsIntegrationEnabled',
|
| + this.syncPrefs.autofillSynced);
|
| +
|
| + this.onSingleSyncDataTypeChanged_();
|
| + },
|
| +
|
| + /**
|
| * Sends the newly created custom sync passphrase to the browser.
|
| * @private
|
| */
|
| @@ -320,6 +336,16 @@ Polymer({
|
| },
|
|
|
| /**
|
| + * @param {boolean} syncAllDataTypes
|
| + * @param {boolean} autofillSynced
|
| + * @return {boolean} Whether the sync checkbox should be disabled.
|
| + */
|
| + shouldPaymentsCheckboxBeDisabled_: function(
|
| + syncAllDataTypes, autofillSynced) {
|
| + return syncAllDataTypes || !autofillSynced;
|
| + },
|
| +
|
| + /**
|
| * Checks the supplied passphrases to ensure that they are not empty and that
|
| * they match each other. Additionally, displays error UI if they are
|
| * invalid.
|
|
|