Chromium Code Reviews| Index: third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h |
| diff --git a/third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h b/third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h |
| index 8c8b75e316af5d7e139d105c866c283971981de3..5dee26f0d8eb1dd8aad097ed3ad4e5bb7e1e3754 100644 |
| --- a/third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h |
| +++ b/third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h |
| @@ -29,16 +29,34 @@ namespace addressinput { |
| // Stores an address. Sample usage: |
| // AddressData address; |
| -// address.country_code = "US"; |
| +// address.recipient = "Chen-Kang Yang"; |
| +// address.organization = "Google"; |
| // address.address_lines.push_back("1098 Alta Ave"); |
| // address.administrative_area = "CA"; |
| // address.locality = "Mountain View"; |
| // address.postal_code = "94043"; |
| -// address.organization = "Google"; |
| -// address.recipient = "Chen-Kang Yang"; |
| +// address.country_code = "US"; |
| // address.language_code = "en"; |
| // Process(address); |
| struct AddressData { |
| + enum FormatType { |
| + // Use the default address format. |
| + FORMAT_FULL, |
| + |
| + // Place a single line break between street address lines and the larger |
| + // areas. |
| + FORMAT_TWO_LINES, |
|
Evan Stade
2014/01/13 22:04:39
what is this going to be used for?
I think the AP
please use gerrit instead
2014/01/14 01:17:47
Done.
New API:
a) AddressData::BuildDisplayLines(
|
| + |
| + // Fit everything on one line. |
| + FORMAT_ONE_LINE |
| + }; |
| + |
| + // Returns the address as a string formatted according to |country_code| |
| + // rules. If there're no address formatting rules for |country_code|, then the |
| + // default rules are used: |
| + // https://i18napis.appspot.com/ssl-address/data/ZZ |
| + std::string ToString(FormatType format_type) const; |
| + |
| // Returns the value of the |field|. The parameter should not be |
| // STREET_ADDRESS, which comprises multiple fields. |
| const std::string& GetField(AddressField field) const; |