Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2369)

Unified Diff: chrome/browser/autofill/phone_number_i18n.cc

Issue 8736001: Pull the phone library directly. Delete old version. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | third_party/libphonenumber/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/phone_number_i18n.cc
===================================================================
--- chrome/browser/autofill/phone_number_i18n.cc (revision 111991)
+++ chrome/browser/autofill/phone_number_i18n.cc (working copy)
@@ -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 @@
*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 @@
return string16();
}
std::string result_utf8(UTF16ToUTF8(result));
- PhoneNumberUtil::NormalizeDigitsOnly(&result_utf8);
+ PhoneNumberUtil::GetInstance()->NormalizeDigitsOnly(&result_utf8);
return UTF8ToUTF16(result_utf8);
}
@@ -176,8 +176,10 @@
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)
return false;
@@ -185,8 +187,6 @@
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))
« no previous file with comments | « DEPS ('k') | third_party/libphonenumber/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698