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

Unified Diff: components/autofill/browser/autofill_profile.cc

Issue 13697002: Make autofill's Address store country using the country code so that app locale isn't needed for th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix remaining tests Created 7 years, 8 months 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
Index: components/autofill/browser/autofill_profile.cc
===================================================================
--- components/autofill/browser/autofill_profile.cc (revision 192389)
+++ components/autofill/browser/autofill_profile.cc (working copy)
@@ -400,14 +400,6 @@
return label_;
}
-const std::string AutofillProfile::CountryCode() const {
- return address_.country_code();
-}
-
-void AutofillProfile::SetCountryCode(const std::string& country_code) {
- address_.set_country_code(country_code);
-}
-
bool AutofillProfile::IsEmpty() const {
FieldTypeSet types;
GetNonEmptyTypes(AutofillCountry::ApplicationLocale(), &types);
@@ -483,9 +475,10 @@
// Phone numbers should be canonicalized prior to being compared.
if (*iter != PHONE_HOME_WHOLE_NUMBER) {
continue;
- } else if (!autofill_i18n::PhoneNumbersMatch(GetRawInfo(*iter),
- profile.GetRawInfo(*iter),
- CountryCode())) {
+ } else if (!autofill_i18n::PhoneNumbersMatch(
+ GetRawInfo(*iter),
+ profile.GetRawInfo(*iter),
+ UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)))) {
return false;
}
} else if (StringToLowerASCII(GetRawInfo(*iter)) !=
@@ -622,7 +615,7 @@
bool AutofillProfile::FillCountrySelectControl(FormFieldData* field_data)
const {
- std::string country_code = CountryCode();
+ std::string country_code = UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY));
std::string app_locale = AutofillCountry::ApplicationLocale();
DCHECK_EQ(field_data->option_values.size(),
@@ -666,8 +659,9 @@
DCHECK(existing_phones);
// Phones allow "fuzzy" matching, so "1-800-FLOWERS", "18003569377",
// "(800)356-9377" and "356-9377" are considered the same.
- if (std::find_if(existing_phones->begin(), existing_phones->end(),
- FindByPhone(phone, CountryCode())) ==
+ if (std::find_if(
+ existing_phones->begin(), existing_phones->end(),
+ FindByPhone(phone, UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)))) ==
existing_phones->end()) {
existing_phones->push_back(phone);
}
« no previous file with comments | « components/autofill/browser/autofill_profile.h ('k') | components/autofill/browser/autofill_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698