| Index: chrome/browser/bookmarks/bookmark_index.h
|
| diff --git a/chrome/browser/bookmarks/bookmark_index.h b/chrome/browser/bookmarks/bookmark_index.h
|
| index 4027e14def711b865eb2c144c15a9d573043d61f..3207ab0fb6dd44641e2fa92d57cfa6f4fe2e71d5 100644
|
| --- a/chrome/browser/bookmarks/bookmark_index.h
|
| +++ b/chrome/browser/bookmarks/bookmark_index.h
|
| @@ -12,17 +12,10 @@
|
| #include "base/basictypes.h"
|
| #include "base/strings/string16.h"
|
|
|
| +class BookmarkClient;
|
| class BookmarkNode;
|
| struct BookmarkTitleMatch;
|
|
|
| -namespace content {
|
| -class BrowserContext;
|
| -}
|
| -
|
| -namespace history {
|
| -class URLDatabase;
|
| -}
|
| -
|
| namespace query_parser {
|
| class QueryNode;
|
| class QueryParser;
|
| @@ -37,7 +30,7 @@ class QueryParser;
|
| // BookmarkNodes that contain that string in their title.
|
| class BookmarkIndex {
|
| public:
|
| - explicit BookmarkIndex(content::BrowserContext* browser_context);
|
| + explicit BookmarkIndex(BookmarkClient* client);
|
| ~BookmarkIndex();
|
|
|
| // Invoked when a bookmark has been added to the model.
|
| @@ -47,10 +40,9 @@ class BookmarkIndex {
|
| void Remove(const BookmarkNode* node);
|
|
|
| // Returns up to |max_count| of bookmarks containing the text |query|.
|
| - void GetBookmarksWithTitlesMatching(
|
| - const base::string16& query,
|
| - size_t max_count,
|
| - std::vector<BookmarkTitleMatch>* results);
|
| + void GetBookmarksWithTitlesMatching(const base::string16& query,
|
| + size_t max_count,
|
| + std::vector<BookmarkTitleMatch>* results);
|
|
|
| private:
|
| typedef std::set<const BookmarkNode*> NodeSet;
|
| @@ -69,14 +61,6 @@ class BookmarkIndex {
|
| void SortMatches(const Matches& matches,
|
| NodeTypedCountPairs* node_typed_counts) const;
|
|
|
| - // Extracts BookmarkNodes from |match| and retrieves typed counts for each
|
| - // node from the in-memory database. Inserts pairs containing the node and
|
| - // typed count into the vector |node_typed_counts|. |node_typed_counts| is
|
| - // sorted in decreasing order of typed count.
|
| - void ExtractBookmarkNodePairs(history::URLDatabase* url_db,
|
| - const Match& match,
|
| - NodeTypedCountPairs* node_typed_counts) const;
|
| -
|
| // Sort function for NodeTypedCountPairs. We sort in decreasing order of typed
|
| // count so that the best matches will always be added to the results.
|
| static bool NodeTypedCountPairSortFunc(const NodeTypedCountPair& a,
|
| @@ -128,9 +112,9 @@ class BookmarkIndex {
|
| // Removes |node| from |index_|.
|
| void UnregisterNode(const base::string16& term, const BookmarkNode* node);
|
|
|
| - Index index_;
|
| + BookmarkClient* client_;
|
|
|
| - content::BrowserContext* browser_context_;
|
| + Index index_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(BookmarkIndex);
|
| };
|
|
|