OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_OBSERVER_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_OBSERVER_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_OBSERVER_H_ |
7 | 7 |
8 class BookmarkModel; | 8 class BookmarkModel; |
9 class BookmarkNode; | 9 class BookmarkNode; |
10 | 10 |
11 // Observer for the BookmarkModel. | 11 // Observer for the BookmarkModel. |
12 class BookmarkModelObserver { | 12 class BookmarkModelObserver { |
13 public: | 13 public: |
14 // Invoked when the model has finished loading. | 14 // Invoked when the model has finished loading. |
15 virtual void Loaded(BookmarkModel* model) = 0; | 15 virtual void Loaded(BookmarkModel* model) = 0; |
16 | 16 |
17 // Invoked from the destructor of the BookmarkModel. | 17 // Invoked from the destructor of the BookmarkModel. |
18 virtual void BookmarkModelBeingDeleted(BookmarkModel* model) {} | 18 virtual void BookmarkModelBeingDeleted(BookmarkModel* model) { } |
19 | 19 |
20 // Invoked when a node has moved. | 20 // Invoked when a node has moved. |
21 virtual void BookmarkNodeMoved(BookmarkModel* model, | 21 virtual void BookmarkNodeMoved(BookmarkModel* model, |
22 const BookmarkNode* old_parent, | 22 const BookmarkNode* old_parent, |
23 int old_index, | 23 int old_index, |
24 const BookmarkNode* new_parent, | 24 const BookmarkNode* new_parent, |
25 int new_index) = 0; | 25 int new_index) = 0; |
26 | 26 |
27 // Invoked when a node has been added. | 27 // Invoked when a node has been added. |
28 virtual void BookmarkNodeAdded(BookmarkModel* model, | 28 virtual void BookmarkNodeAdded(BookmarkModel* model, |
(...skipping 15 matching lines...) Expand all Loading... |
44 const BookmarkNode* node) = 0; | 44 const BookmarkNode* node) = 0; |
45 | 45 |
46 // Invoked when a favicon has finished loading. | 46 // Invoked when a favicon has finished loading. |
47 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 47 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
48 const BookmarkNode* node) = 0; | 48 const BookmarkNode* node) = 0; |
49 | 49 |
50 // Invoked when the children (just direct children, not descendants) of | 50 // Invoked when the children (just direct children, not descendants) of |
51 // |node| have been reordered in some way, such as sorted. | 51 // |node| have been reordered in some way, such as sorted. |
52 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, | 52 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, |
53 const BookmarkNode* node) = 0; | 53 const BookmarkNode* node) = 0; |
54 | |
55 protected: | |
56 ~BookmarkModelObserver() {} | |
57 }; | 54 }; |
58 | 55 |
59 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_OBSERVER_H_ | 56 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_OBSERVER_H_ |
OLD | NEW |