Chromium Code Reviews| Index: chrome/browser/autofill/wallet/wallet_address.cc |
| diff --git a/chrome/browser/autofill/wallet/wallet_address.cc b/chrome/browser/autofill/wallet/wallet_address.cc |
| index 6ae1d6f85fd51e757efeab51556e27cc24822ce8..1069046f64a4c89e89e9b584ff5704ccce906748 100644 |
| --- a/chrome/browser/autofill/wallet/wallet_address.cc |
| +++ b/chrome/browser/autofill/wallet/wallet_address.cc |
| @@ -5,6 +5,7 @@ |
| #include "chrome/browser/autofill/wallet/wallet_address.h" |
| #include "base/logging.h" |
| +#include "base/utf_string_conversions.h" |
| #include "base/values.h" |
| namespace wallet { |
| @@ -62,6 +63,36 @@ scoped_ptr<base::DictionaryValue> Address::ToDictionaryWithoutID() const { |
| return dict.Pass(); |
| } |
| +string16 Address::DisplayName() const { |
| + // TODO(estade): improve this stub implementation. |
| + return UTF8ToUTF16(recipient_name() + ", " + address_line_1()); |
| +} |
| + |
| +string16 Address::GetInfo(AutofillFieldType type) const { |
|
Ilya Sherman
2013/02/12 22:50:34
Optional nit: Mebbe add a DCHECK that the type is
Evan Stade
2013/02/13 00:11:58
Done.
|
| + switch (type) { |
| + case NAME_FULL: |
| + return UTF8ToUTF16(recipient_name()); |
| + |
| + case ADDRESS_HOME_LINE1: |
| + return UTF8ToUTF16(address_line_1()); |
| + |
| + case ADDRESS_HOME_LINE2: |
| + return UTF8ToUTF16(address_line_2()); |
| + |
| + case ADDRESS_HOME_CITY: |
| + return UTF8ToUTF16(locality_name()); |
| + |
| + case ADDRESS_HOME_STATE: |
| + return UTF8ToUTF16(admin_area_name()); |
| + |
| + case ADDRESS_HOME_ZIP: |
| + return UTF8ToUTF16(postal_code_number()); |
| + |
| + // TODO(estade): implement more. |
| + default: |
| + return string16(); |
| + } |
| +} |
| scoped_ptr<Address> |
| Address::CreateAddressWithID(const base::DictionaryValue& dictionary) { |