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 MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void AddConnection(ViewManagerConnection* connection); | 65 void AddConnection(ViewManagerConnection* connection); |
66 void RemoveConnection(ViewManagerConnection* connection); | 66 void RemoveConnection(ViewManagerConnection* connection); |
67 | 67 |
68 // Returns the connection by id. | 68 // Returns the connection by id. |
69 ViewManagerConnection* GetConnection(TransportConnectionId connection_id); | 69 ViewManagerConnection* GetConnection(TransportConnectionId connection_id); |
70 | 70 |
71 // Returns the Node identified by |id|. | 71 // Returns the Node identified by |id|. |
72 Node* GetNode(const NodeId& id); | 72 Node* GetNode(const NodeId& id); |
73 | 73 |
74 // Returns the View identified by |id|. | 74 // Returns the View identified by |id|. |
75 View* GetView(const ViewId& id); | 75 service::View* GetView(const ViewId& id); |
76 | 76 |
77 Node* root() { return &root_; } | 77 Node* root() { return &root_; } |
78 | 78 |
79 // These functions trivially delegate to all ViewManagerConnections, which in | 79 // These functions trivially delegate to all ViewManagerConnections, which in |
80 // term notify their clients. | 80 // term notify their clients. |
81 void NotifyNodeHierarchyChanged(const NodeId& node, | 81 void NotifyNodeHierarchyChanged(const NodeId& node, |
82 const NodeId& new_parent, | 82 const NodeId& new_parent, |
83 const NodeId& old_parent); | 83 const NodeId& old_parent); |
84 void NotifyNodeViewReplaced(const NodeId& node, | 84 void NotifyNodeViewReplaced(const NodeId& node, |
85 const ViewId& new_view_id, | 85 const ViewId& new_view_id, |
86 const ViewId& old_view_id); | 86 const ViewId& old_view_id); |
87 void NotifyNodeDeleted(const NodeId& node); | 87 void NotifyNodeDeleted(const NodeId& node); |
| 88 void NotifyViewDeleted(const ViewId& view); |
88 | 89 |
89 private: | 90 private: |
90 // Used to setup any static state needed by RootNodeManager. | 91 // Used to setup any static state needed by RootNodeManager. |
91 struct Context { | 92 struct Context { |
92 Context(); | 93 Context(); |
93 ~Context(); | 94 ~Context(); |
94 }; | 95 }; |
95 | 96 |
96 // Tracks a change. | 97 // Tracks a change. |
97 struct Change { | 98 struct Change { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 Node root_; | 150 Node root_; |
150 | 151 |
151 DISALLOW_COPY_AND_ASSIGN(RootNodeManager); | 152 DISALLOW_COPY_AND_ASSIGN(RootNodeManager); |
152 }; | 153 }; |
153 | 154 |
154 } // namespace view_manager | 155 } // namespace view_manager |
155 } // namespace services | 156 } // namespace services |
156 } // namespace mojo | 157 } // namespace mojo |
157 | 158 |
158 #endif // MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ | 159 #endif // MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ |
OLD | NEW |