| Index: chrome/browser/autofill/phone_number_i18n.cc
|
| diff --git a/chrome/browser/autofill/phone_number_i18n.cc b/chrome/browser/autofill/phone_number_i18n.cc
|
| index a411dc7878907936e8cfbca36ae48b4c9aebff4c..8560c92e9fec13954eafbe62b72926795d35ee39 100644
|
| --- a/chrome/browser/autofill/phone_number_i18n.cc
|
| +++ b/chrome/browser/autofill/phone_number_i18n.cc
|
| @@ -10,7 +10,7 @@
|
| #include "base/string_number_conversions.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/browser/autofill/autofill_country.h"
|
| -#include "third_party/libphonenumber/src/phonenumber_api.h"
|
| +#include "third_party/libphonenumber/cpp/src/phonenumberutil.h"
|
|
|
| using i18n::phonenumbers::PhoneNumber;
|
| using i18n::phonenumbers::PhoneNumberUtil;
|
| @@ -108,7 +108,7 @@ bool ParsePhoneNumberInternal(const string16& value,
|
| *city_code = UTF8ToUTF16(area_code);
|
| *country_code = string16();
|
|
|
| - phone_util->NormalizeDigitsOnly(&number_text);
|
| + PhoneNumberUtil::NormalizeDigitsOnly(&number_text);
|
| string16 normalized_number(UTF8ToUTF16(number_text));
|
| // Check if parsed number has country code and it was not inferred from the
|
| // locale.
|
| @@ -148,7 +148,7 @@ string16 NormalizePhoneNumber(const string16& value,
|
| return string16();
|
| }
|
| std::string result_utf8(UTF16ToUTF8(result));
|
| - PhoneNumberUtil::GetInstance()->NormalizeDigitsOnly(&result_utf8);
|
| + PhoneNumberUtil::NormalizeDigitsOnly(&result_utf8);
|
| return UTF8ToUTF16(result_utf8);
|
| }
|
|
|
| @@ -176,9 +176,7 @@ bool ConstructPhoneNumber(const string16& country_code,
|
| std::string normalized_number(UTF16ToUTF8(city_code));
|
| normalized_number.append(UTF16ToUTF8(number));
|
|
|
| - PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance();
|
| -
|
| - phone_util->NormalizeDigitsOnly(&normalized_number);
|
| + PhoneNumberUtil::NormalizeDigitsOnly(&normalized_number);
|
|
|
| int64 number_int = 0;
|
| if (!base::StringToInt64(normalized_number, &number_int) || !number_int)
|
| @@ -187,6 +185,8 @@ bool ConstructPhoneNumber(const string16& country_code,
|
| PhoneNumber i18n_number;
|
| i18n_number.set_national_number(static_cast<uint64>(number_int));
|
|
|
| + PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance();
|
| +
|
| int country_int = phone_util->GetCountryCodeForRegion(
|
| SanitizeLocaleCode(locale));
|
| if (!country_code.empty() && !base::StringToInt(country_code, &country_int))
|
|
|