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

Unified Diff: chrome/browser/autocomplete/shortcuts_provider.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger 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: chrome/browser/autocomplete/shortcuts_provider.cc
diff --git a/chrome/browser/autocomplete/shortcuts_provider.cc b/chrome/browser/autocomplete/shortcuts_provider.cc
index 443eb72a10dc26935bad8b2a9597abe02adf0103..dc46d0caed500b503c68686b73a3ebeb9843dcf3 100644
--- a/chrome/browser/autocomplete/shortcuts_provider.cc
+++ b/chrome/browser/autocomplete/shortcuts_provider.cc
@@ -146,7 +146,8 @@ void ShortcutsProvider::GetMatches(const AutocompleteInput& input) {
for (ShortcutsBackend::ShortcutMap::const_iterator it =
FindFirstMatch(term_string, backend.get());
it != backend->shortcuts_map().end() &&
- StartsWith(it->first, term_string, true); ++it) {
+ base::StartsWith(it->first, term_string, true);
+ ++it) {
// Don't return shortcuts with zero relevance.
int relevance = CalculateScore(term_string, it->second, max_relevance);
if (relevance) {
@@ -216,7 +217,7 @@ 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 (StartsWith(match.fill_into_edit, input.text(), false)) {
+ if (base::StartsWith(match.fill_into_edit, input.text(), false)) {
match.inline_autocompletion =
match.fill_into_edit.substr(input.text().length());
match.allowed_to_be_default_match =
@@ -304,7 +305,7 @@ ACMatchClassifications ShortcutsProvider::ClassifyAllMatchesInString(
base::string16 text_lowercase(base::i18n::ToLower(text));
ACMatchClassifications match_class;
size_t last_position = 0;
- if (StartsWith(text_lowercase, find_text, true)) {
+ if (base::StartsWith(text_lowercase, find_text, true)) {
match_class.push_back(
ACMatchClassification(0, ACMatchClassification::MATCH));
last_position = find_text.length();
@@ -368,8 +369,9 @@ ShortcutsBackend::ShortcutMap::const_iterator
// 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()) ||
- StartsWith(it->first, keyword, true)) ? it :
- backend->shortcuts_map().end();
+ base::StartsWith(it->first, keyword, true))
+ ? it
+ : backend->shortcuts_map().end();
}
int ShortcutsProvider::CalculateScore(
« no previous file with comments | « chrome/browser/autocomplete/shortcuts_backend.cc ('k') | chrome/browser/autocomplete/url_index_private_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698