Commit 171a4535 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Avoid ambiguity between ::i18n and ::autofill::i18n.

Unfortunately there are two i18n namespaces, including one
global one, so if you are in ::autofill, referring to i18n is
ambigious if the compiler knows about both of them. This happens
in jumbo builds which means that my previous jumbo fix here didn't
actually work.

Change-Id: I7467ff958e93433581da0134d9a6e8ddd21bde49
Reviewed-on: https://chromium-review.googlesource.com/1057728Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#558364}
parent d15f835a
......@@ -22,12 +22,12 @@ using ::base::android::ScopedJavaLocalRef;
std::string FormatPhoneNumberWithCountryCode(
const std::string& phone_number,
const std::string& country_code,
i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat format) {
i18n::phonenumbers::PhoneNumber parsed_number;
i18n::phonenumbers::PhoneNumberUtil* phone_number_util =
i18n::phonenumbers::PhoneNumberUtil::GetInstance();
::i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat format) {
::i18n::phonenumbers::PhoneNumber parsed_number;
::i18n::phonenumbers::PhoneNumberUtil* phone_number_util =
::i18n::phonenumbers::PhoneNumberUtil::GetInstance();
if (phone_number_util->Parse(phone_number, country_code, &parsed_number) !=
i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR) {
::i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR) {
return phone_number;
}
......@@ -41,7 +41,7 @@ std::string FormatPhoneNumberWithCountryCode(
// not possible.
std::string FormatPhoneNumber(
const std::string& phone_number,
i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat format) {
::i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat format) {
return FormatPhoneNumberWithCountryCode(
phone_number,
autofill::AutofillCountry::CountryCodeForLocale(
......@@ -63,12 +63,12 @@ ScopedJavaLocalRef<jstring> JNI_PhoneNumberUtil_FormatForDisplay(
return ConvertUTF8ToJavaString(
env, jcountry_code.is_null()
? FormatPhoneNumber(ConvertJavaStringToUTF8(env, jphone_number),
i18n::phonenumbers::PhoneNumberUtil::
::i18n::phonenumbers::PhoneNumberUtil::
PhoneNumberFormat::INTERNATIONAL)
: FormatPhoneNumberWithCountryCode(
ConvertJavaStringToUTF8(env, jphone_number),
ConvertJavaStringToUTF8(env, jcountry_code),
i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::
::i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::
INTERNATIONAL));
}
......@@ -84,7 +84,7 @@ ScopedJavaLocalRef<jstring> JNI_PhoneNumberUtil_FormatForResponse(
return ConvertUTF8ToJavaString(
env, FormatPhoneNumber(
ConvertJavaStringToUTF8(env, jphone_number),
i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::E164));
::i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::E164));
}
// Checks whether the given number |jphone_number| is a possible number for a
......@@ -101,7 +101,7 @@ jboolean JNI_PhoneNumberUtil_IsPossibleNumber(
g_browser_process->GetApplicationLocale())
: ConvertJavaStringToUTF8(env, jcountry_code);
return i18n::phonenumbers::PhoneNumberUtil::GetInstance()
return ::i18n::phonenumbers::PhoneNumberUtil::GetInstance()
->IsPossibleNumberForString(phone_number, country_code);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment