Index: components/autofill/content/browser/wallet/wallet_address.cc |
diff --git a/components/autofill/content/browser/wallet/wallet_address.cc b/components/autofill/content/browser/wallet/wallet_address.cc |
index 8ab59982f2bfcc88a162b1a307713e96922c9722..7b950650894849029c754aedf3476b10b70fd2a4 100644 |
--- a/components/autofill/content/browser/wallet/wallet_address.cc |
+++ b/components/autofill/content/browser/wallet/wallet_address.cc |
@@ -127,9 +127,12 @@ Address::Address(const std::string& country_name_code, |
locality_name_(locality_name), |
administrative_area_name_(administrative_area_name), |
postal_code_number_(postal_code_number), |
- phone_number_(phone_number), |
object_id_(object_id), |
is_complete_address_(true) { |
+ // Wallet doesn't store user phone number formatting, so just strip all |
+ // formatting. |
+ i18n::PhoneObject phone(phone_number, country_name_code); |
+ phone_number_ = phone.GetWholeNumber(); |
} |
Address::~Address() {} |
@@ -262,6 +265,14 @@ string16 Address::DisplayNameDetail() const { |
#endif |
} |
+string16 Address::DisplayPhoneNumber() const { |
+ // Return a formatted phone number. Wallet doesn't store user formatting, so |
+ // impose our own. phone_number() always includes a country code, so using |
+ // PhoneObject to format it would result in an internationalized format. Since |
+ // Wallet only supports the US right now, stick to national formatting. |
+ return i18n::FormatPhoneNumberForRegion(phone_number(), country_name_code()); |
+} |
+ |
string16 Address::GetInfo(const AutofillType& type, |
const std::string& app_locale) const { |
if (type.html_type() == HTML_TYPE_COUNTRY_CODE) { |