OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_TITLE_MATCH_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MATCH_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_TITLE_MATCH_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MATCH_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 class BookmarkNode; | 13 class BookmarkNode; |
14 | 14 |
15 struct BookmarkTitleMatch { | 15 struct BookmarkMatch { |
16 // Each MatchPosition is the [begin, end) positions of a match within a | 16 // Each MatchPosition is the [begin, end) positions of a match within a |
17 // string. | 17 // string. |
18 typedef std::pair<size_t, size_t> MatchPosition; | 18 typedef std::pair<size_t, size_t> MatchPosition; |
19 typedef std::vector<MatchPosition> MatchPositions; | 19 typedef std::vector<MatchPosition> MatchPositions; |
20 | 20 |
21 BookmarkTitleMatch(); | 21 BookmarkMatch(); |
22 ~BookmarkTitleMatch(); | 22 ~BookmarkMatch(); |
23 | 23 |
24 // The matching node of a query. | 24 // The matching node of a query. |
25 const BookmarkNode* node; | 25 const BookmarkNode* node; |
26 | 26 |
27 // Location of the matching words in the title of the node. | 27 // Location of the matching words in the title of the node. |
28 MatchPositions match_positions; | 28 MatchPositions title_match_positions; |
| 29 |
| 30 // Location of the matching words in the URL of the node. |
| 31 MatchPositions url_match_positions; |
29 }; | 32 }; |
30 | 33 |
31 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TITLE_MATCH_H_ | 34 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MATCH_H_ |
OLD | NEW |