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

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

Issue 6626070: Fix the settings page for es-419 locale: Spanish (Latin America). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_country_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_country.cc
diff --git a/chrome/browser/autofill/autofill_country.cc b/chrome/browser/autofill/autofill_country.cc
index 7cc8a45b6a949e03be8aed391c997a63bcc7225b..44982e32130cedb89d7953d4e7461f24e281a421 100644
--- a/chrome/browser/autofill/autofill_country.cc
+++ b/chrome/browser/autofill/autofill_country.cc
@@ -386,8 +386,14 @@ const std::string AutofillCountry::CountryCodeForLocale(
// Extract the country code.
std::string country_code = icu::Locale(likely_locale.c_str()).getCountry();
- // Default to the United States if we have no better guess.
- return !country_code.empty() ? country_code : "US";
+ // Default to the United States if we have no better guess. Consider the
+ // country code invalid if it is empty or contains any character other
+ // than A-Z.
+ if (country_code.empty() ||
+ country_code.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ") !=
+ std::string::npos)
Ilya Sherman 2011/03/08 10:35:18 Probably the right check here is actually to see i
satorux1 2011/03/08 11:28:10 Done.
+ return "US";
+ return country_code;
}
// static
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_country_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698