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_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ | 5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ |
6 #define COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ | 6 #define COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 class BookmarkNode; | 10 class BookmarkNode; |
11 class BookmarkModel; | |
11 | 12 |
12 namespace enhanced_bookmarks { | 13 namespace enhanced_bookmarks { |
13 | 14 |
14 class EnhancedBookmarkModelObserver { | 15 class EnhancedBookmarkModelObserver { |
15 public: | 16 public: |
16 // Called when the model has finished loading. | 17 // Called when the model has finished loading. |
17 virtual void EnhancedBookmarkModelLoaded() = 0; | 18 virtual void EnhancedBookmarkModelLoaded() = 0; |
18 | 19 |
19 // Called from EnhancedBookmarkModel::ShutDown. | 20 // Called from EnhancedBookmarkModel::ShutDown. |
20 virtual void EnhancedBookmarkModelShuttingDown() = 0; | 21 virtual void EnhancedBookmarkModelShuttingDown() = 0; |
21 | 22 |
22 // Called when a node is added to the model. | 23 // Called when a node is added to the model. |
23 virtual void EnhancedBookmarkAdded(const BookmarkNode* node) = 0; | 24 virtual void EnhancedBookmarkAdded(const BookmarkNode* node) = 0; |
24 | 25 |
25 // Called when a node is removed from the model. | 26 // Called when a node is removed from the model. |
26 virtual void EnhancedBookmarkRemoved(const BookmarkNode* node) = 0; | 27 virtual void EnhancedBookmarkRemoved(const BookmarkNode* node) = 0; |
27 | 28 |
29 // Called when a node has changed. | |
30 virtual void EnhancedBookmarkNodeChanged(BookmarkModel* model, | |
31 const BookmarkNode* node) = 0; | |
noyau (Ping after 24h)
2014/10/29 10:23:05
Why passing the bookmarkModel as an argument here?
danduong
2014/10/29 20:26:09
Done.
| |
32 | |
28 // Called when all user editable nodes are removed from the model. | 33 // Called when all user editable nodes are removed from the model. |
29 virtual void EnhancedBookmarkAllUserNodesRemoved() = 0; | 34 virtual void EnhancedBookmarkAllUserNodesRemoved() = 0; |
30 | 35 |
31 // Called when the remote id of a node changes. If |remote_id| is empty, the | 36 // Called when the remote id of a node changes. If |remote_id| is empty, the |
32 // remote id has been cleared. This could happen if multiple nodes with the | 37 // remote id has been cleared. This could happen if multiple nodes with the |
33 // same remote id has been detected. | 38 // same remote id has been detected. |
34 virtual void EnhancedBookmarkRemoteIdChanged(const BookmarkNode* node, | 39 virtual void EnhancedBookmarkRemoteIdChanged(const BookmarkNode* node, |
35 const std::string& old_remote_id, | 40 const std::string& old_remote_id, |
36 const std::string& remote_id) {}; | 41 const std::string& remote_id) {}; |
37 | 42 |
38 protected: | 43 protected: |
39 virtual ~EnhancedBookmarkModelObserver() {} | 44 virtual ~EnhancedBookmarkModelObserver() {} |
40 }; | 45 }; |
41 | 46 |
42 } // namespace enhanced_bookmarks | 47 } // namespace enhanced_bookmarks |
43 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ | 48 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ |
OLD | NEW |