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

Unified Diff: chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js

Issue 2092323002: [MD Settings] Add a menu option to clear a cached credit card. (Closed) Base URL: hcarmona0.lax.corp.google.com:/usr/local/google/home/hcarmona/src@cc-clear-cache.gitbr
Patch Set: 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/passwords_and_forms_page/passwords_and_forms_page.js
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
index a932c48b5f2e4a97d54ac7f2f501f5f40e18565a..f38f36fc4a1b2aaaacc2540c1e91a21561abb55e 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
@@ -144,6 +144,12 @@ AutofillManager.prototype = {
removeCreditCard: assertNotReached,
/**
+ * @param {!AutofillManager.CreditCardEntry} creditCard The credit card to
+ * remove from the local cache.
+ */
+ clearCachedCreditCard: assertNotReached,
+
+ /**
* Saves the given credit card.
* @param {!AutofillManager.CreditCardEntry} creditCard
*/
@@ -272,6 +278,12 @@ AutofillManagerImpl.prototype = {
},
/** @override */
+ clearCachedCreditCard: function(creditCard) {
+ chrome.autofillPrivate.maskCreditCard(
+ /** @type {string} */(creditCard.guid));
tommycli 2016/06/25 00:36:01 These typecasts seem interesting. Are these variab
hcarmona 2016/06/27 22:22:32 Tried something else. WDYT?
+ },
+
+ /** @override */
saveCreditCard: function(creditCard) {
chrome.autofillPrivate.saveCreditCard(creditCard);
}
@@ -326,6 +338,7 @@ Polymer({
},
listeners: {
+ 'clear-credit-card': 'clearCreditCard_',
'remove-address': 'removeAddress_',
'remove-credit-card': 'removeCreditCard_',
'remove-password-exception': 'removePasswordException_',
@@ -435,6 +448,15 @@ Polymer({
},
/**
+ * Listens for the clear-credit-card event, and calls the private API.
+ * @param {!Event} event
+ * @private
+ */
+ clearCreditCard_: function(event) {
+ this.autofillManager_.clearCachedCreditCard(event.detail);
+ },
+
+ /**
* Shows the manage autofill sub page.
* @param {!Event} event
* @private

Powered by Google App Engine
This is Rietveld 408576698