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

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

Issue 2583763003: Factor out AutocompleteMatch creation from BookmarkProvider (Closed)
Patch Set: copyright years, bookmarks namespace Created 3 years, 11 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 | « components/omnibox/browser/BUILD.gn ('k') | components/omnibox/browser/bookmark_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/bookmark_provider.h
diff --git a/components/omnibox/browser/bookmark_provider.h b/components/omnibox/browser/bookmark_provider.h
index bb2c71b087304c65b99187037ac5b986dfacf6b5..25a2bcb1398817b5cf11a20ff2ca71226de5f066 100644
--- a/components/omnibox/browser/bookmark_provider.h
+++ b/components/omnibox/browser/bookmark_provider.h
@@ -12,9 +12,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "components/omnibox/browser/autocomplete_input.h"
-#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_provider.h"
-#include "components/query_parser/snippet.h"
class AutocompleteProviderClient;
@@ -55,24 +53,9 @@ class BookmarkProvider : public AutocompleteProvider {
// |matches_|.
void DoAutocomplete(const AutocompleteInput& input);
- // Compose an AutocompleteMatch based on |match| that has 1) the URL of
- // |match|'s bookmark, and 2) the bookmark's title, not the URL's page
- // title, as the description. |input| is used to compute the match's
- // inline_autocompletion. |fixed_up_input_text| is used in that way as well;
- // it's passed separately so this function doesn't have to compute it.
- AutocompleteMatch TitledUrlMatchToACMatch(
- const AutocompleteInput& input,
- const base::string16& fixed_up_input_text,
- const bookmarks::TitledUrlMatch& match);
-
- // Converts |positions| into ACMatchClassifications and returns the
- // classifications. |text_length| is used to determine the need to add an
- // 'unhighlighted' classification span so the tail of the source string
- // properly highlighted.
- static ACMatchClassifications ClassificationsFromMatch(
- const query_parser::Snippet::MatchPositions& positions,
- size_t text_length,
- bool is_url);
+ // Calculates the relevance score for |match|.
+ int CalculateBookmarkMatchRelevance(
+ const bookmarks::TitledUrlMatch& match) const;
AutocompleteProviderClient* client_;
bookmarks::BookmarkModel* bookmark_model_;
« no previous file with comments | « components/omnibox/browser/BUILD.gn ('k') | components/omnibox/browser/bookmark_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698