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

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: 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..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.
« 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