Chromium Code Reviews| Index: components/bookmarks/browser/titled_url_index.h |
| diff --git a/components/bookmarks/browser/bookmark_index.h b/components/bookmarks/browser/titled_url_index.h |
| similarity index 68% |
| rename from components/bookmarks/browser/bookmark_index.h |
| rename to components/bookmarks/browser/titled_url_index.h |
| index 52a510d4dbdf68001be0d3be93c5364f97bf72e2..5843b2646574a4b8a6da3f99bf141f9a577efbdb 100644 |
| --- a/components/bookmarks/browser/bookmark_index.h |
| +++ b/components/bookmarks/browser/titled_url_index.h |
| @@ -1,9 +1,9 @@ |
| -// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
sky
2016/12/13 23:57:26
Don't update the copyrights as this is a move.
mattreynolds
2016/12/14 01:14:21
Undone.
|
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_INDEX_H_ |
| -#define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_INDEX_H_ |
| +#ifndef COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_INDEX_H_ |
| +#define COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_INDEX_H_ |
| #include <stddef.h> |
| @@ -20,19 +20,17 @@ namespace bookmarks { |
| class TitledUrlNode; |
| class TitledUrlNodeSorter; |
| -struct BookmarkMatch; |
| +struct TitledUrlMatch; |
| -// BookmarkIndex maintains an index of the titles and URLs of bookmarks for |
| -// quick look up. BookmarkIndex is owned and maintained by BookmarkModel, you |
| -// shouldn't need to interact directly with BookmarkIndex. |
| +// TitledUrlIndex maintains an index of paired titles and URLs for quick lookup. |
| // |
| -// BookmarkIndex maintains the index (index_) as a map of sets. The map (type |
| -// Index) maps from a lower case string to the set (type NodeSet) of |
| +// TitledUrlIndex maintains the index (index_) as a map of sets. The map (type |
| +// Index) maps from a lower case string to the set (type TitledUrlNodeSet) of |
| // TitledUrlNodes that contain that string in their title or URL. |
| -class BookmarkIndex { |
| +class TitledUrlIndex { |
| public: |
| - BookmarkIndex(std::unique_ptr<TitledUrlNodeSorter> sorter); |
| - ~BookmarkIndex(); |
| + TitledUrlIndex(std::unique_ptr<TitledUrlNodeSorter> sorter); |
| + ~TitledUrlIndex(); |
| // Invoked when a title/URL pair has been added to the model. |
| void Add(const TitledUrlNode* node); |
| @@ -45,16 +43,15 @@ class BookmarkIndex { |
| void GetResultsMatching(const base::string16& query, |
| size_t max_count, |
| query_parser::MatchingAlgorithm matching_algorithm, |
| - std::vector<BookmarkMatch>* results); |
| + std::vector<TitledUrlMatch>* results); |
| private: |
| using TitledUrlNodes = std::vector<const TitledUrlNode*>; |
| using TitledUrlNodeSet = std::set<const TitledUrlNode*>; |
| using Index = std::map<base::string16, TitledUrlNodeSet>; |
| - // Constructs |sorted_nodes| by taking the matches in |matches| and sorting |
| - // them in decreasing order of typed count (if supported by the client) and |
| - // deduping them. |
| + // Constructs |sorted_nodes| by copying the matches in |matches| and sorting |
| + // them. |
| void SortMatches(const TitledUrlNodeSet& matches, |
| TitledUrlNodes* sorted_nodes) const; |
| @@ -62,7 +59,7 @@ class BookmarkIndex { |
| void AddMatchToResults(const TitledUrlNode* node, |
| query_parser::QueryParser* parser, |
| const query_parser::QueryNodeVector& query_nodes, |
| - std::vector<BookmarkMatch>* results); |
| + std::vector<TitledUrlMatch>* results); |
| // Populates |matches| for the specified term. If |first_term| is true, this |
| // is the first term in the query. Returns true if there is at least one node |
| @@ -86,9 +83,9 @@ class BookmarkIndex { |
| std::unique_ptr<TitledUrlNodeSorter> sorter_; |
| - DISALLOW_COPY_AND_ASSIGN(BookmarkIndex); |
| + DISALLOW_COPY_AND_ASSIGN(TitledUrlIndex); |
| }; |
| } // namespace bookmarks |
| -#endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_INDEX_H_ |
| +#endif // COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_INDEX_H_ |