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

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

Issue 1947293002: Implement autofill Address and Credit Card lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 9801b6eb42079a265972363f6d0278302e5efe27..1aa535287a78ffbf825b7f21865d3865591865ce 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
@@ -7,9 +7,63 @@
* addresses and credit cards for use in autofill.
*/
(function() {
-'use strict';
+ 'use strict';
-Polymer({
- is: 'settings-autofill-section',
-});
+ Polymer({
+ is: 'settings-autofill-section',
+
+ properties: {
+ /**
+ * An array of saved addresses.
+ * @type {!Array<!chrome.autofillPrivate.AddressEntry>}
+ */
+ addresses: {
+ type: Array,
+ },
+
+ /**
+ * An array of saved addresses.
+ * @type {!Array<!chrome.autofillPrivate.CreditCardEntry>}
+ */
+ creditCards: {
+ type: Array,
+ },
+ },
+
+ /**
+ * Formats an AddressEntry so it's displayed as an address.
+ * @param {!chrome.autofillPrivate.AddressEntry} item
+ * @return {!string}
+ */
+ address_: function(item) {
+ return item.metadata.summaryLabel + item.metadata.summarySublabel;
+ },
+
+ /**
+ * Formats the expiration date so it's displayed as MM/YYYY.
+ * @param {!chrome.autofillPrivate.CreditCardEntry} item
+ * @return {!string}
+ */
+ expiration_: function(item) {
+ return item.expirationMonth + '/' + item.expirationYear;
+ },
+
+ /**
+ * Handles tapping on the "Add address" button.
+ * @param {!Event} e
+ */
+ onAddAddressTap_: function(e) {
+ // TODO(hcarmona): implement this.
+ e.preventDefault();
+ },
+
+ /**
+ * Handles tapping on the "Add credit card" button.
+ * @param {!Event} e
+ */
+ onAddCreditCardTap_: function(e) {
+ // TODO(hcarmona): implement this.
+ e.preventDefault();
+ },
+ });
})();

Powered by Google App Engine
This is Rietveld 408576698