summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/autofill/android/personal_data_manager_android.cc6
-rw-r--r--chrome/browser/resources/options/autofill_options.html53
-rw-r--r--chrome/browser/resources/options/autofill_options.js6
3 files changed, 40 insertions, 25 deletions
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.cc b/chrome/browser/autofill/android/personal_data_manager_android.cc
index 1b3f11a..527f29d 100644
--- a/chrome/browser/autofill/android/personal_data_manager_android.cc
+++ b/chrome/browser/autofill/android/personal_data_manager_android.cc
@@ -22,6 +22,7 @@
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/personal_data_manager.h"
+#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "jni/PersonalDataManager_jni.h"
@@ -354,13 +355,12 @@ static jboolean IsWalletImportFeatureAvailable(JNIEnv* env, jclass clazz) {
// Returns whether the Wallet import feature is enabled.
static jboolean IsWalletImportEnabled(JNIEnv* env, jclass clazz) {
- // TODO(estade): there is no pref yet, so just pretend yes.
- return true;
+ return GetPrefs()->GetBoolean(autofill::prefs::kAutofillWalletImportEnabled);
}
// Enables or disables the Wallet import feature.
static void SetWalletImportEnabled(JNIEnv* env, jclass clazz, jboolean enable) {
- // TODO(estade): there is no pref yet, so no-op.
+ GetPrefs()->SetBoolean(autofill::prefs::kAutofillWalletImportEnabled, enable);
}
// Returns an ISO 3166-1-alpha-2 country code for a |jcountry_name| using
diff --git a/chrome/browser/resources/options/autofill_options.html b/chrome/browser/resources/options/autofill_options.html
index 91529fb..716cedd 100644
--- a/chrome/browser/resources/options/autofill_options.html
+++ b/chrome/browser/resources/options/autofill_options.html
@@ -12,6 +12,27 @@
</label>
</div>
</if>
+ <!-- TODO(estade): This section shouldn't show if you're not signed into
+ sync. Or perhaps it should show with a link to go sign in with sync?
+ -->
+ <div id="autofill-wallet-setting-area" class="settings-row" hidden>
+ <div class="checkbox">
+ <label>
+ <input pref="autofill.wallet_import_enabled" type="checkbox">
+ <span>
+ Include
+ <a target="_blank" i18n-values="href:manageWalletAddressesUrl">
+ addresses</a>
+ and
+ <a target="_blank"
+ i18n-values="href:manageWalletPaymentMethodsUrl">cards</a>
+ stored in your Google Wallet
+ <!-- A reminder not to launch this UI. -->
+ <span style="font-size: 80%">translate me!</span>
+ </span>
+ </div>
+ </div>
+
<h3 i18n-content="autofillAddresses"></h3>
<div class="settings-list">
<list id="address-list"></list>
@@ -20,6 +41,7 @@
</button>
</div>
</div>
+
<h3 i18n-content="autofillCreditCards"></h3>
<div class="settings-list">
<list id="creditcard-list"></list>
@@ -28,29 +50,20 @@
i18n-content="autofillAddCreditCard"></button>
</div>
</div>
- <!-- TODO(estade): This section shouldn't show if you're not signed into
- sync. -->
- <div id="autofill-wallet-card-area" class="settings-row" hidden>
+
+ <!-- TODO(estade): what do we do with this section when the pref is unset?
+ -->
+ <div id="autofill-wallet-remask-cards-area">
+ <span class="settings-row">Credit cards from Wallet require authentication
+ once and then remain unlocked.
+ </span>
+ <a id="remask-server-cards-link"
+ is="action-link">Reset authenticated cards</a>
<!-- A reminder not to launch this UI. -->
- <span>Warning, these strings are not translated!</span>
- <div>
- Chrome will also suggest
- <a target="_blank" i18n-values="href:manageWalletAddressesUrl">
- addresses</a>
- and
- <a target="_blank" i18n-values="href:manageWalletPaymentMethodsUrl">
- cards</a>
- stored in your Wallet.
- </div>
- <div>
- <span>Credit cards from Wallet require authentication once and
- then remain unlocked.
- </span>
- <a id="remask-server-cards-link"
- is="action-link">Reset authenticated cards</a>
- </div>
+ <span style="font-size: 80%">translate me!</span>
</div>
</div>
+
<div class="action-area">
<a id="autofill-help" target="_blank" i18n-values="href:helpUrl"
i18n-content="helpButton">
diff --git a/chrome/browser/resources/options/autofill_options.js b/chrome/browser/resources/options/autofill_options.js
index 49ce81f..ce9775d 100644
--- a/chrome/browser/resources/options/autofill_options.js
+++ b/chrome/browser/resources/options/autofill_options.js
@@ -89,8 +89,10 @@ cr.define('options', function() {
return true; // Always follow the href
};
- $('autofill-wallet-card-area').hidden =
- !loadTimeData.getBoolean('enableAutofillWalletIntegration');
+ var enableWalletIntegration =
+ loadTimeData.getBoolean('enableAutofillWalletIntegration');
+ $('autofill-wallet-remask-cards-area').hidden = !enableWalletIntegration;
+ $('autofill-wallet-setting-area').hidden = !enableWalletIntegration;
// TODO(estade): there should probably be some indication of success.
$('remask-server-cards-link').onclick = function(event) {
chrome.send('remaskServerCards');