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

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: fix 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 67df7f28542e206d1c47f29a1ffcf52e76c0e7c4..48f3b2076db8b026b6894805b2222ce4d65c0faf 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.
Justin Donnelly 2016/06/14 19:56:41 s/payments/Payments/
tommycli 2016/06/14 20:42:09 Done.
+ if (!this.syncPrefs.autofillRegistered || !this.syncPrefs.autofillSynced)
+ this.set('syncPrefs.paymentsIntegrationEnabled', false);
Justin Donnelly 2016/06/14 19:56:41 I think there may be an opportunity to fix https:/
tommycli 2016/06/14 20:42:09 Acknowledged. Deferred to a different patch / disc
+
// 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() {
@@ -210,6 +215,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
*/
@@ -315,6 +331,15 @@ Polymer({
},
/**
+ * @param {boolean} syncAllDataTypes
+ * @param {boolean} autofillSynced
+ * @return {boolean} Whether the sync checkbox should be disabled.
+ */
+ shouldWalletCheckboxBeDisabled_: 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