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 9801b6eb42079a265972363f6d0278302e5efe27..988ad15d7c895d95c1d370d3af765f51e849a3bd 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/YY. |
| + * @param {!chrome.autofillPrivate.CreditCardEntry} item |
| + * @return {!string} |
| + */ |
| + expiration_: function(item) { |
| + return item.expirationMonth + '/' + item.expirationYear; |
|
Dan Beam
2016/05/06 22:01:46
is this international?
hcarmona
2016/05/07 01:01:25
Old settings uses MM/YYYY format also. There's no
Dan Beam
2016/05/09 17:48:46
that's fine, there's just a ton of variations in A
|
| + }, |
| + |
| + /** |
| + * 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(); |
| + }, |
| + }); |
| })(); |