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

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

Issue 312423003: Cleanup AutocompleteInput and AutocompleteProvider Functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Return a std::pair Created 6 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/bookmark_provider.cc
diff --git a/chrome/browser/autocomplete/bookmark_provider.cc b/chrome/browser/autocomplete/bookmark_provider.cc
index 3437562b537e07268643cae03dd955fbb6b8ec34..2b18d2946339211e3e617f11ad646cd739755e6b 100644
--- a/chrome/browser/autocomplete/bookmark_provider.cc
+++ b/chrome/browser/autocomplete/bookmark_provider.cc
@@ -86,8 +86,7 @@ void BookmarkProvider::DoAutocomplete(const AutocompleteInput& input) {
&matches);
if (matches.empty())
return; // There were no matches.
- AutocompleteInput fixed_up_input(input);
- FixupUserInput(&fixed_up_input);
+ const base::string16 fixed_up_input(FixupUserInput(input).second);
for (BookmarkMatches::const_iterator i = matches.begin(); i != matches.end();
++i) {
// Create and score the AutocompleteMatch. If its score is 0 then the
@@ -138,7 +137,7 @@ class ScoringFunctor {
AutocompleteMatch BookmarkProvider::BookmarkMatchToACMatch(
const AutocompleteInput& input,
- const AutocompleteInput& fixed_up_input,
+ const base::string16& fixed_up_input_text,
const BookmarkMatch& bookmark_match) {
// The AutocompleteMatch we construct is non-deletable because the only
// way to support this would be to delete the underlying bookmark, which is
@@ -149,7 +148,7 @@ AutocompleteMatch BookmarkProvider::BookmarkMatchToACMatch(
const GURL& url(bookmark_match.node->url());
const base::string16& url_utf16 = base::UTF8ToUTF16(url.spec());
size_t inline_autocomplete_offset = URLPrefix::GetInlineAutocompleteOffset(
- input, fixed_up_input, false, url_utf16);
+ input.text(), fixed_up_input_text, false, url_utf16);
match.destination_url = url;
const size_t match_start = bookmark_match.url_match_positions.empty() ?
0 : bookmark_match.url_match_positions[0].first;
« no previous file with comments | « chrome/browser/autocomplete/bookmark_provider.h ('k') | chrome/browser/autocomplete/bookmark_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698