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

Unified Diff: third_party/libaddressinput/chromium/cpp/src/rule.cc

Issue 237693002: requestAutocomplete should not unlatinize administrative region names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: third_party/libaddressinput/chromium/cpp/src/rule.cc
diff --git a/third_party/libaddressinput/chromium/cpp/src/rule.cc b/third_party/libaddressinput/chromium/cpp/src/rule.cc
index 791ac9eca651bbba4d68945ffad93ffaafe454c4..1cc28f29a1af5ff5842fe266f485521cbb77c327 100644
--- a/third_party/libaddressinput/chromium/cpp/src/rule.cc
+++ b/third_party/libaddressinput/chromium/cpp/src/rule.cc
@@ -376,6 +376,7 @@ int Rule::GetInvalidFieldMessageId(AddressField field) const {
}
bool Rule::CanonicalizeSubKey(const std::string& user_input,
+ bool canonicalize_latin_name,
std::string* sub_key) const {
if (sub_keys_.empty()) {
*sub_key = user_input;
@@ -384,7 +385,8 @@ bool Rule::CanonicalizeSubKey(const std::string& user_input,
return GetMatchingSubKey(user_input, sub_keys_, sub_key) ||
GetMatchingSubKey(user_input, sub_names_, sub_key) ||
- GetMatchingSubKey(user_input, sub_lnames_, sub_key);
+ GetMatchingSubKey(user_input, sub_lnames_,
+ canonicalize_latin_name ? sub_key : NULL);
}
bool Rule::GetMatchingSubKey(const std::string& target,
@@ -392,7 +394,9 @@ bool Rule::GetMatchingSubKey(const std::string& target,
std::string* sub_key) const {
for (size_t i = 0; i < values.size(); ++i) {
if (LooseStringCompare(values[i], target)) {
- *sub_key = sub_keys_[i];
+ if (sub_key != NULL) {
+ *sub_key = sub_keys_[i];
+ }
return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698