| Index: components/bookmarks/core/browser/bookmark_match.h
|
| diff --git a/components/bookmarks/core/browser/bookmark_title_match.h b/components/bookmarks/core/browser/bookmark_match.h
|
| similarity index 52%
|
| rename from components/bookmarks/core/browser/bookmark_title_match.h
|
| rename to components/bookmarks/core/browser/bookmark_match.h
|
| index be45f4ffd6c12aabc59eb151933db06ca1c9dc5e..cfe6cf09eb05934983681ac6e8c9a199b893c14f 100644
|
| --- a/components/bookmarks/core/browser/bookmark_title_match.h
|
| +++ b/components/bookmarks/core/browser/bookmark_match.h
|
| @@ -5,27 +5,39 @@
|
| #ifndef COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_TITLE_MATCH_H_
|
| #define COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_TITLE_MATCH_H_
|
|
|
| -#include <stddef.h>
|
| -
|
| #include <utility>
|
| #include <vector>
|
|
|
| class BookmarkNode;
|
|
|
| -struct BookmarkTitleMatch {
|
| +struct BookmarkMatch {
|
| // Each MatchPosition is the [begin, end) positions of a match within a
|
| // string.
|
| typedef std::pair<size_t, size_t> MatchPosition;
|
| typedef std::vector<MatchPosition> MatchPositions;
|
|
|
| - BookmarkTitleMatch();
|
| - ~BookmarkTitleMatch();
|
| + BookmarkMatch();
|
| + ~BookmarkMatch();
|
| +
|
| + // Extracts and returns the offsets from |match_positions|.
|
| + static std::vector<size_t> OffsetsFromMatchPositions(
|
| + const MatchPositions& match_positions);
|
| +
|
| + // Replaces the offsets in |match_positions| with those given in |offsets|,
|
| + // deleting any which are npos, and returns the updated list of match
|
| + // positions.
|
| + static MatchPositions ReplaceOffsetsInMatchPositions(
|
| + const MatchPositions& match_positions,
|
| + const std::vector<size_t>& offsets);
|
|
|
| // The matching node of a query.
|
| const BookmarkNode* node;
|
|
|
| // Location of the matching words in the title of the node.
|
| - MatchPositions match_positions;
|
| + MatchPositions title_match_positions;
|
| +
|
| + // Location of the matching words in the URL of the node.
|
| + MatchPositions url_match_positions;
|
| };
|
|
|
| #endif // COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_TITLE_MATCH_H_
|
|
|