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

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

Issue 184663002: Omnibox: Make URLs of Bookmarks Searchable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tested; works 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: chrome/browser/autocomplete/url_prefix.cc
diff --git a/chrome/browser/autocomplete/url_prefix.cc b/chrome/browser/autocomplete/url_prefix.cc
index 1d680db593014dba849110d29223211b5f76837c..bfbdea0463974fb49ad3e0ba77c9268f19b8a21e 100644
--- a/chrome/browser/autocomplete/url_prefix.cc
+++ b/chrome/browser/autocomplete/url_prefix.cc
@@ -77,13 +77,11 @@ bool URLPrefix::PrefixMatch(const URLPrefix& prefix,
}
// static
-void URLPrefix::ComputeMatchStartAndInlineAutocompleteOffset(
+size_t URLPrefix::GetInlineAutocompleteOffset(
const AutocompleteInput& input,
const AutocompleteInput& fixed_up_input,
const bool allow_www_prefix_without_scheme,
- const base::string16& text,
- size_t* match_start,
- size_t* inline_autocomplete_offset) {
+ const base::string16& text) {
const URLPrefix* best_prefix = allow_www_prefix_without_scheme ?
BestURLPrefixWithWWWCase(text, input.text()) :
BestURLPrefix(text, input.text());
@@ -99,12 +97,7 @@ void URLPrefix::ComputeMatchStartAndInlineAutocompleteOffset(
BestURLPrefix(text, fixed_up_input.text());
matching_string = &fixed_up_input.text();
}
- if (best_prefix != NULL) {
- *match_start = best_prefix->prefix.length();
- *inline_autocomplete_offset =
- best_prefix->prefix.length() + matching_string->length();
- } else {
- *match_start = base::string16::npos;
- *inline_autocomplete_offset = base::string16::npos;
- }
+ if (best_prefix != NULL)
+ return best_prefix->prefix.length() + matching_string->length();
+ return base::string16::npos;
Peter Kasting 2014/04/16 23:44:25 Tiny nit: Fractionally less verbose: return bes
Mark P 2014/04/17 20:24:18 Okay.
}

Powered by Google App Engine
This is Rietveld 408576698