Chromium Code Reviews| Index: chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js |
| diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js |
| index ab491edefbf06b5ee2b90b71a2851a2f7642e988..911db856fefd2da51cb303ca248144dd403f550f 100644 |
| --- a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js |
| +++ b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js |
| @@ -39,7 +39,7 @@ |
| /** |
| * Formats an AddressEntry so it's displayed as an address. |
| * @param {!chrome.autofillPrivate.AddressEntry} item |
| - * @return {!string} |
| + * @return {string} |
| */ |
| address_: function(item) { |
| return item.metadata.summaryLabel + item.metadata.summarySublabel; |
| @@ -48,7 +48,7 @@ |
| /** |
| * Formats the expiration date so it's displayed as MM/YYYY. |
| * @param {!chrome.autofillPrivate.CreditCardEntry} item |
| - * @return {!string} |
| + * @return {string} |
| */ |
| expiration_: function(item) { |
| return item.expirationMonth + '/' + item.expirationYear; |
| @@ -121,7 +121,12 @@ |
| * @private |
| */ |
| onAddCreditCardTap_: function(e) { |
| - // TODO(hcarmona): implement adding a credit card. |
| + var date = new Date(); // Default to current month/year. |
| + // Pass in a new object to edit. |
| + this.$.editCreditCardDialog.open({ |
| + expirationMonth: date.getMonth() + 1, // Months are 0 based. |
|
michaelpg
2016/05/27 17:57:07
open() takes a CreditCardEntry, in which these are
hcarmona
2016/05/31 21:14:06
Done.
|
| + expirationYear: date.getFullYear(), |
| + }); |
| e.preventDefault(); |
| }, |
| @@ -130,8 +135,10 @@ |
| * @private |
| */ |
| onMenuEditCreditCardTap_: function() { |
| - // TODO(hcarmona): implement editing a credit card. |
| - this.$.creditCardSharedMenu.closeMenu(); |
| + var menu = this.$.creditCardSharedMenu; |
| + this.$.editCreditCardDialog.open( |
| + /** @type {chrome.autofillPrivate.CreditCardEntry} */(menu.itemData)); |
| + menu.closeMenu(); |
| }, |
| /** |