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 namespace bookmarks { | |
10 class BookmarkNode; | 11 class BookmarkNode; |
12 } | |
11 | 13 |
12 namespace enhanced_bookmarks { | 14 namespace enhanced_bookmarks { |
13 | 15 |
14 class EnhancedBookmarkModelObserver { | 16 class EnhancedBookmarkModelObserver { |
15 public: | 17 public: |
16 // Called when the model has finished loading. | 18 // Called when the model has finished loading. |
17 virtual void EnhancedBookmarkModelLoaded() = 0; | 19 virtual void EnhancedBookmarkModelLoaded() = 0; |
18 | 20 |
19 // Called from EnhancedBookmarkModel::ShutDown. | 21 // Called from EnhancedBookmarkModel::ShutDown. |
20 virtual void EnhancedBookmarkModelShuttingDown() = 0; | 22 virtual void EnhancedBookmarkModelShuttingDown() = 0; |
21 | 23 |
22 // Called when a node is added to the model. | 24 // Called when a node is added to the model. |
23 virtual void EnhancedBookmarkAdded(const BookmarkNode* node) = 0; | 25 virtual void EnhancedBookmarkAdded(const bookmarks::BookmarkNode* node) = 0; |
24 | 26 |
25 // Called when a node is removed from the model. | 27 // Called when a node is removed from the model. |
26 virtual void EnhancedBookmarkRemoved(const BookmarkNode* node) = 0; | 28 virtual void EnhancedBookmarkRemoved(const bookmarks::BookmarkNode* node) = 0; |
27 | 29 |
28 // Called when a node has changed. | 30 // Called when a node has changed. |
29 virtual void EnhancedBookmarkNodeChanged(const BookmarkNode* node) = 0; | 31 virtual void EnhancedBookmarkNodeChanged( |
32 const bookmarks::BookmarkNode* node) = 0; | |
30 | 33 |
31 // Called when all user editable nodes are removed from the model. | 34 // Called when all user editable nodes are removed from the model. |
32 virtual void EnhancedBookmarkAllUserNodesRemoved() = 0; | 35 virtual void EnhancedBookmarkAllUserNodesRemoved() = 0; |
33 | 36 |
34 // Called when the remote id of a node changes. If |remote_id| is empty, the | 37 // Called when the remote id of a node changes. If |remote_id| is empty, the |
35 // remote id has been cleared. This could happen if multiple nodes with the | 38 // remote id has been cleared. This could happen if multiple nodes with the |
36 // same remote id has been detected. | 39 // same remote id has been detected. |
37 virtual void EnhancedBookmarkRemoteIdChanged(const BookmarkNode* node, | 40 virtual void EnhancedBookmarkRemoteIdChanged( |
38 const std::string& old_remote_id, | 41 const bookmarks::BookmarkNode* node, |
39 const std::string& remote_id) {}; | 42 const std::string& old_remote_id, |
43 const std::string& remote_id){}; | |
sky
2015/02/03 17:08:37
nit: no ;
tfarina
2015/02/04 20:51:14
Done.
| |
40 | 44 |
41 protected: | 45 protected: |
42 virtual ~EnhancedBookmarkModelObserver() {} | 46 virtual ~EnhancedBookmarkModelObserver() {} |
43 }; | 47 }; |
44 | 48 |
45 } // namespace enhanced_bookmarks | 49 } // namespace enhanced_bookmarks |
50 | |
46 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ | 51 #endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ |
OLD | NEW |