OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MODEL_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/sequenced_task_runner.h" |
16 #include "base/string16.h" | 17 #include "base/string16.h" |
17 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
18 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
19 #include "chrome/browser/bookmarks/bookmark_service.h" | 20 #include "chrome/browser/bookmarks/bookmark_service.h" |
20 #include "chrome/browser/profiles/profile_keyed_service.h" | 21 #include "chrome/browser/profiles/profile_keyed_service.h" |
21 #include "chrome/common/cancelable_task_tracker.h" | 22 #include "chrome/common/cancelable_task_tracker.h" |
22 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
23 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
24 #include "googleurl/src/gurl.h" | 25 #include "googleurl/src/gurl.h" |
25 #include "ui/base/models/tree_node_model.h" | 26 #include "ui/base/models/tree_node_model.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 public ProfileKeyedService { | 230 public ProfileKeyedService { |
230 public: | 231 public: |
231 explicit BookmarkModel(Profile* profile); | 232 explicit BookmarkModel(Profile* profile); |
232 virtual ~BookmarkModel(); | 233 virtual ~BookmarkModel(); |
233 | 234 |
234 // Invoked prior to destruction to release any necessary resources. | 235 // Invoked prior to destruction to release any necessary resources. |
235 virtual void Shutdown() OVERRIDE; | 236 virtual void Shutdown() OVERRIDE; |
236 | 237 |
237 // Loads the bookmarks. This is called upon creation of the | 238 // Loads the bookmarks. This is called upon creation of the |
238 // BookmarkModel. You need not invoke this directly. | 239 // BookmarkModel. You need not invoke this directly. |
239 void Load(); | 240 void Load(const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
240 | 241 |
241 // Returns true if the model finished loading. | 242 // Returns true if the model finished loading. |
242 // This is virtual so it can be mocked. | 243 // This is virtual so it can be mocked. |
243 virtual bool IsLoaded() const; | 244 virtual bool IsLoaded() const; |
244 | 245 |
245 // Returns the root node. The 'bookmark bar' node and 'other' node are | 246 // Returns the root node. The 'bookmark bar' node and 'other' node are |
246 // children of the root node. | 247 // children of the root node. |
247 const BookmarkNode* root_node() { return &root_; } | 248 const BookmarkNode* root_node() { return &root_; } |
248 | 249 |
249 // Returns the 'bookmark bar' node. This is NULL until loaded. | 250 // Returns the 'bookmark bar' node. This is NULL until loaded. |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 524 |
524 // See description of IsDoingExtensiveChanges above. | 525 // See description of IsDoingExtensiveChanges above. |
525 int extensive_changes_; | 526 int extensive_changes_; |
526 | 527 |
527 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 528 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
528 | 529 |
529 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 530 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
530 }; | 531 }; |
531 | 532 |
532 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 533 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
OLD | NEW |