Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4231)

Unified Diff: chrome/browser/resources/settings/people_page/sync_page.js

Issue 2068653003: Settings People Revamp: Add Payments integration to new Sync Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698