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

Unified Diff: components/omnibox/url_prefix.cc

Issue 1220653002: Fix some case-insensitive cases for StartsWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt's review comments, Mac fix Created 5 years, 6 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/omnibox/url_prefix.cc
diff --git a/components/omnibox/url_prefix.cc b/components/omnibox/url_prefix.cc
index b1fdcdb7e77698c452e6f339d437825201bc02c5..86759ded6f1132a7a9204f3a9f63c461fa09ea40 100644
--- a/components/omnibox/url_prefix.cc
+++ b/components/omnibox/url_prefix.cc
@@ -5,6 +5,7 @@
#include "components/omnibox/url_prefix.h"
#include "base/basictypes.h"
+#include "base/i18n/case_conversion.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -71,7 +72,10 @@ const URLPrefix* URLPrefix::BestURLPrefix(const base::string16& text,
bool URLPrefix::PrefixMatch(const URLPrefix& prefix,
const base::string16& text,
const base::string16& prefix_suffix) {
- return base::StartsWith(text, prefix.prefix + prefix_suffix, false);
+ return base::StartsWith(
+ base::i18n::ToLower(text),
+ base::i18n::ToLower(prefix.prefix + prefix_suffix),
+ base::CompareCase::SENSITIVE);
}
// static
« no previous file with comments | « components/omnibox/suggestion_answer.cc ('k') | components/password_manager/core/browser/password_autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698