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

Unified Diff: components/omnibox/browser/bookmark_provider.cc

Issue 2537223008: Add TitledUrlIndex for indexing arbitrary title/URL pairs (Closed)
Patch Set: refactor in-place to preserve history Created 4 years 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: components/omnibox/browser/bookmark_provider.cc
diff --git a/components/omnibox/browser/bookmark_provider.cc b/components/omnibox/browser/bookmark_provider.cc
index 5068690db9765924cd2103e47448aa4ecc89011b..c08f2e7145f4b7eb69cd45c5fa92dc1ed5e96f0c 100644
--- a/components/omnibox/browser/bookmark_provider.cc
+++ b/components/omnibox/browser/bookmark_provider.cc
@@ -165,11 +165,11 @@ AutocompleteMatch BookmarkProvider::BookmarkMatchToACMatch(
// unlikely to be what the user intends.
AutocompleteMatch match(this, 0, false,
AutocompleteMatchType::BOOKMARK_TITLE);
- base::string16 title(bookmark_match.node->GetTitle());
+ base::string16 title(bookmark_match.node->GetTitledUrlNodeTitle());
BookmarkMatch::MatchPositions new_title_match_positions =
bookmark_match.title_match_positions;
CorrectTitleAndMatchPositions(&title, &new_title_match_positions);
- const GURL& url(bookmark_match.node->url());
+ const GURL& url(bookmark_match.node->GetTitledUrlNodeUrl());
const base::string16& url_utf16 = base::UTF8ToUTF16(url.spec());
size_t inline_autocomplete_offset = URLPrefix::GetInlineAutocompleteOffset(
input.text(), fixed_up_input_text, false, url_utf16);
@@ -281,7 +281,8 @@ AutocompleteMatch BookmarkProvider::BookmarkMatchToACMatch(
ScoringFunctor url_position_functor =
for_each(bookmark_match.url_match_positions.begin(),
bookmark_match.url_match_positions.end(),
- ScoringFunctor(bookmark_match.node->url().spec().length()));
+ ScoringFunctor(
+ bookmark_match.node->GetTitledUrlNodeUrl().spec().length()));
const double title_match_strength = title_position_functor.ScoringFactor();
const double summed_factors = title_match_strength +
url_position_functor.ScoringFactor();

Powered by Google App Engine
This is Rietveld 408576698