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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
19 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
20 #include "components/bookmarks/browser/bookmark_client.h" | 20 #include "components/bookmarks/browser/bookmark_client.h" |
21 #include "components/bookmarks/browser/bookmark_node.h" | 21 #include "components/bookmarks/browser/bookmark_node.h" |
22 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
24 | 24 |
25 class BookmarkExpandedStateTracker; | 25 class BookmarkExpandedStateTracker; |
26 class BookmarkModelObserver; | 26 class BookmarkModelObserver; |
27 struct BookmarkMatch; | |
28 class PrefService; | 27 class PrefService; |
29 class ScopedGroupBookmarkActions; | |
30 | 28 |
31 namespace base { | 29 namespace base { |
32 class FilePath; | 30 class FilePath; |
33 class SequencedTaskRunner; | 31 class SequencedTaskRunner; |
34 } | 32 } |
35 | 33 |
36 namespace bookmarks { | 34 namespace bookmarks { |
37 class BookmarkIndex; | 35 class BookmarkIndex; |
38 class BookmarkLoadDetails; | 36 class BookmarkLoadDetails; |
39 class BookmarkStorage; | 37 class BookmarkStorage; |
40 class ScopedGroupBookmarkActions; | 38 class ScopedGroupBookmarkActions; |
| 39 struct BookmarkMatch; |
41 } | 40 } |
42 | 41 |
43 namespace favicon_base { | 42 namespace favicon_base { |
44 struct FaviconImageResult; | 43 struct FaviconImageResult; |
45 } | 44 } |
46 | 45 |
47 namespace test { | 46 namespace test { |
48 class TestBookmarkClient; | 47 class TestBookmarkClient; |
49 } | 48 } |
50 | 49 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Sets the date when the folder was modified. | 236 // Sets the date when the folder was modified. |
238 void SetDateFolderModified(const BookmarkNode* node, const base::Time time); | 237 void SetDateFolderModified(const BookmarkNode* node, const base::Time time); |
239 | 238 |
240 // Resets the 'date modified' time of the node to 0. This is used during | 239 // Resets the 'date modified' time of the node to 0. This is used during |
241 // importing to exclude the newly created folders from showing up in the | 240 // importing to exclude the newly created folders from showing up in the |
242 // combobox of most recently modified folders. | 241 // combobox of most recently modified folders. |
243 void ResetDateFolderModified(const BookmarkNode* node); | 242 void ResetDateFolderModified(const BookmarkNode* node); |
244 | 243 |
245 // Returns up to |max_count| of bookmarks containing each term from |text| | 244 // Returns up to |max_count| of bookmarks containing each term from |text| |
246 // in either the title or the URL. | 245 // in either the title or the URL. |
247 void GetBookmarksMatching( | 246 void GetBookmarksMatching(const base::string16& text, |
248 const base::string16& text, | 247 size_t max_count, |
249 size_t max_count, | 248 std::vector<bookmarks::BookmarkMatch>* matches); |
250 std::vector<BookmarkMatch>* matches); | |
251 | 249 |
252 // Sets the store to NULL, making it so the BookmarkModel does not persist | 250 // Sets the store to NULL, making it so the BookmarkModel does not persist |
253 // any changes to disk. This is only useful during testing to speed up | 251 // any changes to disk. This is only useful during testing to speed up |
254 // testing. | 252 // testing. |
255 void ClearStore(); | 253 void ClearStore(); |
256 | 254 |
257 // Returns the next node ID. | 255 // Returns the next node ID. |
258 int64 next_node_id() const { return next_node_id_; } | 256 int64 next_node_id() const { return next_node_id_; } |
259 | 257 |
260 // Returns the object responsible for tracking the set of expanded nodes in | 258 // Returns the object responsible for tracking the set of expanded nodes in |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 426 |
429 // See description of IsDoingExtensiveChanges above. | 427 // See description of IsDoingExtensiveChanges above. |
430 int extensive_changes_; | 428 int extensive_changes_; |
431 | 429 |
432 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 430 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
433 | 431 |
434 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 432 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
435 }; | 433 }; |
436 | 434 |
437 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 435 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |