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

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: fix ALL_MATCHES (in response to recent changes) 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
« no previous file with comments | « chrome/browser/autocomplete/url_prefix.h ('k') | chrome/browser/bookmarks/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8a49f2c95836b2bbd741e3adde99861e5d4bca98 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;
- }
+ return (best_prefix != NULL) ?
+ (best_prefix->prefix.length() + matching_string->length()) :
+ base::string16::npos;
}
« no previous file with comments | « chrome/browser/autocomplete/url_prefix.h ('k') | chrome/browser/bookmarks/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698