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

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

Issue 2015463003: Add dialog to edit and save credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/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();
},
/**

Powered by Google App Engine
This is Rietveld 408576698