Chromium Code Reviews| 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 |