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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 // | 59 // |
60 // You should NOT directly create a BookmarkModel, instead go through the | 60 // You should NOT directly create a BookmarkModel, instead go through the |
61 // BookmarkModelFactory. | 61 // BookmarkModelFactory. |
62 class BookmarkModel : public KeyedService { | 62 class BookmarkModel : public KeyedService { |
63 public: | 63 public: |
64 struct URLAndTitle { | 64 struct URLAndTitle { |
65 GURL url; | 65 GURL url; |
66 base::string16 title; | 66 base::string16 title; |
67 }; | 67 }; |
68 | 68 |
69 // |index_urls| says whether URLs should be stored in the BookmarkIndex | 69 BookmarkModel(bookmarks::BookmarkClient* client); |
sky
2014/08/21 23:56:04
explicit
Mark P
2014/08/22 15:56:39
Done.
| |
70 // in addition to bookmark titles. | |
71 BookmarkModel(bookmarks::BookmarkClient* client, bool index_urls); | |
72 virtual ~BookmarkModel(); | 70 virtual ~BookmarkModel(); |
73 | 71 |
74 // KeyedService: | 72 // KeyedService: |
75 virtual void Shutdown() OVERRIDE; | 73 virtual void Shutdown() OVERRIDE; |
76 | 74 |
77 // Loads the bookmarks. This is called upon creation of the | 75 // Loads the bookmarks. This is called upon creation of the |
78 // BookmarkModel. You need not invoke this directly. | 76 // BookmarkModel. You need not invoke this directly. |
79 // All load operations will be executed on |io_task_runner| and the completion | 77 // All load operations will be executed on |io_task_runner| and the completion |
80 // callback will be called from |ui_task_runner|. | 78 // callback will be called from |ui_task_runner|. |
81 void Load(PrefService* pref_service, | 79 void Load(PrefService* pref_service, |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 base::Lock url_lock_; | 406 base::Lock url_lock_; |
409 | 407 |
410 // Used for loading favicons. | 408 // Used for loading favicons. |
411 base::CancelableTaskTracker cancelable_task_tracker_; | 409 base::CancelableTaskTracker cancelable_task_tracker_; |
412 | 410 |
413 // Reads/writes bookmarks to disk. | 411 // Reads/writes bookmarks to disk. |
414 scoped_ptr<bookmarks::BookmarkStorage> store_; | 412 scoped_ptr<bookmarks::BookmarkStorage> store_; |
415 | 413 |
416 scoped_ptr<bookmarks::BookmarkIndex> index_; | 414 scoped_ptr<bookmarks::BookmarkIndex> index_; |
417 | 415 |
418 // True if URLs are stored in the BookmarkIndex in addition to bookmark | |
419 // titles. | |
420 const bool index_urls_; | |
421 | |
422 base::WaitableEvent loaded_signal_; | 416 base::WaitableEvent loaded_signal_; |
423 | 417 |
424 // See description of IsDoingExtensiveChanges above. | 418 // See description of IsDoingExtensiveChanges above. |
425 int extensive_changes_; | 419 int extensive_changes_; |
426 | 420 |
427 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_; | 421 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_; |
428 | 422 |
429 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 423 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
430 }; | 424 }; |
431 | 425 |
432 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 426 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |