diff options
author | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 22:23:12 +0000 |
---|---|---|
committer | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 22:23:12 +0000 |
commit | 5f6f7f25502d4de4fc2be2c9bd28ee6f8bbc06ee (patch) | |
tree | 6059c87b386ffb6351019962901171e32fcd6074 /chrome/browser/autofill | |
parent | 1e99e51e96241c92af518d60bb78cb306dc2ef42 (diff) | |
download | chromium_src-5f6f7f25502d4de4fc2be2c9bd28ee6f8bbc06ee.zip chromium_src-5f6f7f25502d4de4fc2be2c9bd28ee6f8bbc06ee.tar.gz chromium_src-5f6f7f25502d4de4fc2be2c9bd28ee6f8bbc06ee.tar.bz2 |
Pull the phone library directly. Delete old version.
TEST=unit-tests
BUG=105577
Review URL: http://codereview.chromium.org/8736001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r-- | chrome/browser/autofill/phone_number_i18n.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/autofill/phone_number_i18n.cc b/chrome/browser/autofill/phone_number_i18n.cc index 8560c92..a411dc7 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/cpp/src/phonenumberutil.h" +#include "third_party/libphonenumber/src/phonenumber_api.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(); - PhoneNumberUtil::NormalizeDigitsOnly(&number_text); + phone_util->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::NormalizeDigitsOnly(&result_utf8); + PhoneNumberUtil::GetInstance()->NormalizeDigitsOnly(&result_utf8); return UTF8ToUTF16(result_utf8); } @@ -176,7 +176,9 @@ bool ConstructPhoneNumber(const string16& country_code, std::string normalized_number(UTF16ToUTF8(city_code)); normalized_number.append(UTF16ToUTF8(number)); - PhoneNumberUtil::NormalizeDigitsOnly(&normalized_number); + PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); + + phone_util->NormalizeDigitsOnly(&normalized_number); int64 number_int = 0; if (!base::StringToInt64(normalized_number, &number_int) || !number_int) @@ -185,8 +187,6 @@ 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)) |