| 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 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
| 27 | 27 |
| 28 class BookmarkExpandedStateTracker; | 28 class BookmarkExpandedStateTracker; |
| 29 class BookmarkIndex; | 29 class BookmarkIndex; |
| 30 class BookmarkLoadDetails; | 30 class BookmarkLoadDetails; |
| 31 class BookmarkModel; | 31 class BookmarkModel; |
| 32 class BookmarkModelObserver; | 32 class BookmarkModelObserver; |
| 33 class BookmarkStorage; | 33 class BookmarkStorage; |
| 34 class Profile; | 34 class Profile; |
| 35 | 35 |
| 36 namespace base { |
| 37 class SequencedTaskRunner; |
| 38 } |
| 39 |
| 36 namespace bookmark_utils { | 40 namespace bookmark_utils { |
| 37 struct TitleMatch; | 41 struct TitleMatch; |
| 38 } | 42 } |
| 39 | 43 |
| 40 namespace history { | 44 namespace history { |
| 41 struct FaviconImageResult; | 45 struct FaviconImageResult; |
| 42 } | 46 } |
| 43 | 47 |
| 44 // BookmarkNode --------------------------------------------------------------- | 48 // BookmarkNode --------------------------------------------------------------- |
| 45 | 49 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 public ProfileKeyedService { | 233 public ProfileKeyedService { |
| 230 public: | 234 public: |
| 231 explicit BookmarkModel(Profile* profile); | 235 explicit BookmarkModel(Profile* profile); |
| 232 virtual ~BookmarkModel(); | 236 virtual ~BookmarkModel(); |
| 233 | 237 |
| 234 // Invoked prior to destruction to release any necessary resources. | 238 // Invoked prior to destruction to release any necessary resources. |
| 235 virtual void Shutdown() OVERRIDE; | 239 virtual void Shutdown() OVERRIDE; |
| 236 | 240 |
| 237 // Loads the bookmarks. This is called upon creation of the | 241 // Loads the bookmarks. This is called upon creation of the |
| 238 // BookmarkModel. You need not invoke this directly. | 242 // BookmarkModel. You need not invoke this directly. |
| 239 void Load(); | 243 // All load operations will be executed on |task_runner|. |
| 244 void Load(const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
| 240 | 245 |
| 241 // Returns true if the model finished loading. | 246 // Returns true if the model finished loading. |
| 242 // This is virtual so it can be mocked. | 247 // This is virtual so it can be mocked. |
| 243 virtual bool IsLoaded() const; | 248 virtual bool IsLoaded() const; |
| 244 | 249 |
| 245 // Returns the root node. The 'bookmark bar' node and 'other' node are | 250 // Returns the root node. The 'bookmark bar' node and 'other' node are |
| 246 // children of the root node. | 251 // children of the root node. |
| 247 const BookmarkNode* root_node() { return &root_; } | 252 const BookmarkNode* root_node() { return &root_; } |
| 248 | 253 |
| 249 // Returns the 'bookmark bar' node. This is NULL until loaded. | 254 // Returns the 'bookmark bar' node. This is NULL until loaded. |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 544 |
| 540 // See description of IsDoingExtensiveChanges above. | 545 // See description of IsDoingExtensiveChanges above. |
| 541 int extensive_changes_; | 546 int extensive_changes_; |
| 542 | 547 |
| 543 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 548 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
| 544 | 549 |
| 545 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 550 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 546 }; | 551 }; |
| 547 | 552 |
| 548 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 553 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
| OLD | NEW |