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

Unified Diff: components/autofill/core/browser/autofill_field.cc

Issue 1582353006: CountryNames: Separate data creation from usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@571610_exposeCountryNamesToTesting
Patch Set: More Android fixes Created 4 years, 11 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/core/browser/autofill_field.cc
diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc
index 145d7a04dd692d4c82c087076cd385bd6b86fae4..9ef2e2b27282c3afb731a5bd91c10bba32aebc19 100644
--- a/components/autofill/core/browser/autofill_field.cc
+++ b/components/autofill/core/browser/autofill_field.cc
@@ -174,10 +174,8 @@ bool FillStateSelectControl(const base::string16& value,
}
bool FillCountrySelectControl(const base::string16& value,
- const std::string& app_locale,
FormFieldData* field_data) {
- std::string country_code =
- CountryNames::GetInstance()->GetCountryCode(value, app_locale);
+ std::string country_code = CountryNames::GetInstance()->GetCountryCode(value);
if (country_code.empty())
return false;
@@ -188,10 +186,8 @@ bool FillCountrySelectControl(const base::string16& value,
// target country code.
base::string16 value = field_data->option_values[i];
base::string16 contents = field_data->option_contents[i];
- if (country_code ==
- CountryNames::GetInstance()->GetCountryCode(value, app_locale) ||
- country_code ==
- CountryNames::GetInstance()->GetCountryCode(contents, app_locale)) {
+ if (country_code == CountryNames::GetInstance()->GetCountryCode(value) ||
+ country_code == CountryNames::GetInstance()->GetCountryCode(contents)) {
field_data->value = value;
return true;
}
@@ -349,7 +345,7 @@ bool FillSelectControl(const AutofillType& type,
if (storable_type == ADDRESS_HOME_STATE) {
return FillStateSelectControl(value, field);
} else if (storable_type == ADDRESS_HOME_COUNTRY) {
- return FillCountrySelectControl(value, app_locale, field);
+ return FillCountrySelectControl(value, field);
} else if (storable_type == CREDIT_CARD_EXP_2_DIGIT_YEAR ||
storable_type == CREDIT_CARD_EXP_4_DIGIT_YEAR) {
return FillYearSelectControl(value, field);

Powered by Google App Engine
This is Rietveld 408576698