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

Unified Diff: chrome/browser/resources/options/sync_setup_overlay.js

Issue 1578173005: Move Autofill Payments integration checkbox to the sync settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace bool with enum in tests Created 4 years, 11 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/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..50a297a373ebead001ce4cd4a1d5da9e1c599bfd 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,11 @@ cr.define('options', function() {
$('use-default-link').onclick = function() {
self.showSyncEverythingPage_();
};
+ $('autofill-checkbox').onclick = function() {
+ var autofillSyncEnabled = $('autofill-checkbox').checked;
+ $('payments-integration-checkbox').checked = autofillSyncEnabled;
+ $('payments-integration-checkbox').disabled = !autofillSyncEnabled;
+ };
},
/** @private */
@@ -210,6 +216,7 @@ cr.define('options', function() {
for (var i = 0; i < checkboxes.length; i++) {
checkboxes[i].checked = value;
}
+ $('payments-integration-checkbox').checked = value;
},
/**
@@ -330,6 +337,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 +345,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': syncAll ||
+ (autofillSynced && $('payments-integration-checkbox').checked),
'encryptAllData': encryptAllData,
'usePassphrase': usePassphrase,
'isGooglePassphrase': googlePassphrase,
@@ -367,6 +377,7 @@ cr.define('options', function() {
for (var i = 0; i < configureElements.length; i++)
configureElements[i].disabled = disabled;
$('sync-select-datatypes').disabled = disabled;
+ $('payments-integration-checkbox').disabled = disabled;
$('customize-link').hidden = disabled;
$('customize-link').disabled = disabled;
@@ -420,9 +431,15 @@ cr.define('options', function() {
this.dataTypeBoxesChecked_['autofill-checkbox'] = args.autofillSynced;
this.dataTypeBoxesDisabled_['autofill-checkbox'] =
args.autofillEnforced;
+ this.dataTypeBoxesChecked_['payments-integration-checkbox'] =
+ args.autofillSynced && args.paymentsIntegrationEnabled;
+ this.dataTypeBoxesDisabled_['payments-integration-checkbox'] =
+ !args.autofillSynced;
$('autofill-item').hidden = false;
+ $('payments-integration-setting-area').hidden = false;
} else {
$('autofill-item').hidden = true;
+ $('payments-integration-setting-area').hidden = true;
}
if (args.extensionsRegistered) {
$('extensions-checkbox').checked = args.extensionsSynced;
« no previous file with comments | « chrome/browser/resources/options/sync_setup_overlay.html ('k') | chrome/browser/ui/webui/options/autofill_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698