OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 28 matching lines...) Expand all Loading... |
39 class BookmarkStorage; | 39 class BookmarkStorage; |
40 class ScopedGroupBookmarkActions; | 40 class ScopedGroupBookmarkActions; |
41 class TestBookmarkClient; | 41 class TestBookmarkClient; |
42 struct BookmarkMatch; | 42 struct BookmarkMatch; |
43 } | 43 } |
44 | 44 |
45 namespace favicon_base { | 45 namespace favicon_base { |
46 struct FaviconImageResult; | 46 struct FaviconImageResult; |
47 } | 47 } |
48 | 48 |
| 49 namespace query_parser { |
| 50 enum class MatchingAlgorithm; |
| 51 } |
| 52 |
49 // BookmarkModel -------------------------------------------------------------- | 53 // BookmarkModel -------------------------------------------------------------- |
50 | 54 |
51 // BookmarkModel provides a directed acyclic graph of URLs and folders. | 55 // BookmarkModel provides a directed acyclic graph of URLs and folders. |
52 // Three graphs are provided for the three entry points: those on the 'bookmarks | 56 // Three graphs are provided for the three entry points: those on the 'bookmarks |
53 // bar', those in the 'other bookmarks' folder and those in the 'mobile' folder. | 57 // bar', those in the 'other bookmarks' folder and those in the 'mobile' folder. |
54 // | 58 // |
55 // An observer may be attached to observe relevant events. | 59 // An observer may be attached to observe relevant events. |
56 // | 60 // |
57 // You should NOT directly create a BookmarkModel, instead go through the | 61 // You should NOT directly create a BookmarkModel, instead go through the |
58 // BookmarkModelFactory. | 62 // BookmarkModelFactory. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 232 |
229 // Sets the date when the folder was modified. | 233 // Sets the date when the folder was modified. |
230 void SetDateFolderModified(const BookmarkNode* node, const base::Time time); | 234 void SetDateFolderModified(const BookmarkNode* node, const base::Time time); |
231 | 235 |
232 // Resets the 'date modified' time of the node to 0. This is used during | 236 // Resets the 'date modified' time of the node to 0. This is used during |
233 // importing to exclude the newly created folders from showing up in the | 237 // importing to exclude the newly created folders from showing up in the |
234 // combobox of most recently modified folders. | 238 // combobox of most recently modified folders. |
235 void ResetDateFolderModified(const BookmarkNode* node); | 239 void ResetDateFolderModified(const BookmarkNode* node); |
236 | 240 |
237 // Returns up to |max_count| of bookmarks containing each term from |text| | 241 // Returns up to |max_count| of bookmarks containing each term from |text| |
238 // in either the title or the URL. | 242 // in either the title or the URL. It uses default matching algorithm. |
239 void GetBookmarksMatching(const base::string16& text, | 243 void GetBookmarksMatching(const base::string16& text, |
240 size_t max_count, | 244 size_t max_count, |
241 std::vector<bookmarks::BookmarkMatch>* matches); | 245 std::vector<bookmarks::BookmarkMatch>* matches); |
242 | 246 |
| 247 // Returns up to |max_count| of bookmarks containing each term from |text| |
| 248 // in either the title or the URL. |
| 249 void GetBookmarksMatching( |
| 250 const base::string16& text, |
| 251 size_t max_count, |
| 252 query_parser::MatchingAlgorithm matching_algorithm, |
| 253 std::vector<bookmarks::BookmarkMatch>* matches); |
| 254 |
243 // Sets the store to NULL, making it so the BookmarkModel does not persist | 255 // Sets the store to NULL, making it so the BookmarkModel does not persist |
244 // any changes to disk. This is only useful during testing to speed up | 256 // any changes to disk. This is only useful during testing to speed up |
245 // testing. | 257 // testing. |
246 void ClearStore(); | 258 void ClearStore(); |
247 | 259 |
248 // Returns the next node ID. | 260 // Returns the next node ID. |
249 int64 next_node_id() const { return next_node_id_; } | 261 int64 next_node_id() const { return next_node_id_; } |
250 | 262 |
251 // Returns the object responsible for tracking the set of expanded nodes in | 263 // Returns the object responsible for tracking the set of expanded nodes in |
252 // the bookmark editor. | 264 // the bookmark editor. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 426 |
415 // See description of IsDoingExtensiveChanges above. | 427 // See description of IsDoingExtensiveChanges above. |
416 int extensive_changes_; | 428 int extensive_changes_; |
417 | 429 |
418 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_; | 430 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_; |
419 | 431 |
420 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 432 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
421 }; | 433 }; |
422 | 434 |
423 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 435 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |