OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // | 168 // |
169 // You should NOT directly create a BookmarkModel, instead go through the | 169 // You should NOT directly create a BookmarkModel, instead go through the |
170 // Profile. | 170 // Profile. |
171 class BookmarkModel : public NotificationObserver, public BookmarkService { | 171 class BookmarkModel : public NotificationObserver, public BookmarkService { |
172 public: | 172 public: |
173 explicit BookmarkModel(Profile* profile); | 173 explicit BookmarkModel(Profile* profile); |
174 virtual ~BookmarkModel(); | 174 virtual ~BookmarkModel(); |
175 | 175 |
176 static void RegisterUserPrefs(PrefService* prefs); | 176 static void RegisterUserPrefs(PrefService* prefs); |
177 | 177 |
| 178 // Invoked prior to destruction to release any necessary resources. |
| 179 void Cleanup(); |
| 180 |
178 // Loads the bookmarks. This is called by Profile upon creation of the | 181 // Loads the bookmarks. This is called by Profile upon creation of the |
179 // BookmarkModel. You need not invoke this directly. | 182 // BookmarkModel. You need not invoke this directly. |
180 void Load(); | 183 void Load(); |
181 | 184 |
182 // Returns true if the model finished loading. | 185 // Returns true if the model finished loading. |
183 // This is virtual so it can be mocked. | 186 // This is virtual so it can be mocked. |
184 virtual bool IsLoaded() const; | 187 virtual bool IsLoaded() const; |
185 | 188 |
186 // Returns the root node. The 'bookmark bar' node and 'other' node are | 189 // Returns the root node. The 'bookmark bar' node and 'other' node are |
187 // children of the root node. | 190 // children of the root node. |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 scoped_ptr<BookmarkIndex> index_; | 457 scoped_ptr<BookmarkIndex> index_; |
455 | 458 |
456 base::WaitableEvent loaded_signal_; | 459 base::WaitableEvent loaded_signal_; |
457 | 460 |
458 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 461 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
459 | 462 |
460 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 463 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
461 }; | 464 }; |
462 | 465 |
463 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 466 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
OLD | NEW |