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

Unified Diff: components/omnibox/shortcuts_provider.cc

Issue 1214183008: Update StartsWith calls to use new versions in chrome and content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « components/omnibox/shortcuts_backend.cc ('k') | components/omnibox/url_index_private_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/shortcuts_provider.cc
diff --git a/components/omnibox/shortcuts_provider.cc b/components/omnibox/shortcuts_provider.cc
index 03d44f79878e367feb246c100fcd3459d513b194..6b33313b6e5284700e8c2d63781f0df9ce5ceded 100644
--- a/components/omnibox/shortcuts_provider.cc
+++ b/components/omnibox/shortcuts_provider.cc
@@ -136,7 +136,8 @@ void ShortcutsProvider::GetMatches(const AutocompleteInput& input) {
for (ShortcutsBackend::ShortcutMap::const_iterator it =
FindFirstMatch(term_string, backend.get());
it != backend->shortcuts_map().end() &&
- base::StartsWith(it->first, term_string, true);
+ base::StartsWith(it->first, term_string,
+ base::CompareCase::SENSITIVE);
++it) {
// Don't return shortcuts with zero relevance.
int relevance = CalculateScore(term_string, it->second, max_relevance);
@@ -217,7 +218,9 @@ AutocompleteMatch ShortcutsProvider::ShortcutToACMatch(
// input of "foo.c" to autocomplete to "foo.com" for a fill_into_edit of
// "http://foo.com".
if (AutocompleteMatch::IsSearchType(match.type)) {
- if (base::StartsWith(match.fill_into_edit, input.text(), false)) {
+ if (base::StartsWith(base::i18n::ToLower(match.fill_into_edit),
+ base::i18n::ToLower(input.text()),
+ base::CompareCase::SENSITIVE)) {
match.inline_autocompletion =
match.fill_into_edit.substr(input.text().length());
match.allowed_to_be_default_match =
@@ -305,7 +308,8 @@ ACMatchClassifications ShortcutsProvider::ClassifyAllMatchesInString(
base::string16 text_lowercase(base::i18n::ToLower(text));
ACMatchClassifications match_class;
size_t last_position = 0;
- if (base::StartsWith(text_lowercase, find_text, true)) {
+ if (base::StartsWith(text_lowercase, find_text,
+ base::CompareCase::SENSITIVE)) {
match_class.push_back(
ACMatchClassification(0, ACMatchClassification::MATCH));
last_position = find_text.length();
@@ -369,7 +373,7 @@ ShortcutsBackend::ShortcutMap::const_iterator ShortcutsProvider::FindFirstMatch(
// Lower bound not necessarily matches the keyword, check for item pointed by
// the lower bound iterator to at least start with keyword.
return ((it == backend->shortcuts_map().end()) ||
- base::StartsWith(it->first, keyword, true))
+ base::StartsWith(it->first, keyword, base::CompareCase::SENSITIVE))
? it
: backend->shortcuts_map().end();
}
« no previous file with comments | « components/omnibox/shortcuts_backend.cc ('k') | components/omnibox/url_index_private_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698