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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 View* GetView(const ViewId& id); | 75 View* GetView(const ViewId& id); |
76 | 76 |
77 Node* root() { return &root_; } | 77 Node* root() { return &root_; } |
78 | 78 |
79 bool IsProcessingChange() const { return change_source_ != 0; } | 79 bool IsProcessingChange() const { return change_source_ != 0; } |
80 | 80 |
81 bool is_processing_delete_node() const { return is_processing_delete_node_; } | 81 bool is_processing_delete_node() const { return is_processing_delete_node_; } |
82 | 82 |
83 // These functions trivially delegate to all ViewManagerConnections, which in | 83 // These functions trivially delegate to all ViewManagerConnections, which in |
84 // term notify their clients. | 84 // term notify their clients. |
| 85 void ProcessNodeBoundsChanged(const Node* node, |
| 86 const gfx::Rect& old_bounds, |
| 87 const gfx::Rect& new_bounds); |
85 void ProcessNodeHierarchyChanged(const Node* node, | 88 void ProcessNodeHierarchyChanged(const Node* node, |
86 const Node* new_parent, | 89 const Node* new_parent, |
87 const Node* old_parent); | 90 const Node* old_parent); |
88 void ProcessNodeViewReplaced(const Node* node, | 91 void ProcessNodeViewReplaced(const Node* node, |
89 const View* new_view_id, | 92 const View* new_view_id, |
90 const View* old_view_id); | 93 const View* old_view_id); |
91 void ProcessNodeDeleted(const NodeId& node); | 94 void ProcessNodeDeleted(const NodeId& node); |
92 void ProcessViewDeleted(const ViewId& view); | 95 void ProcessViewDeleted(const ViewId& view); |
93 | 96 |
94 private: | 97 private: |
(...skipping 14 matching lines...) Expand all Loading... |
109 void PrepareForChange(ViewManagerConnection* connection, bool is_delete_node); | 112 void PrepareForChange(ViewManagerConnection* connection, bool is_delete_node); |
110 | 113 |
111 // Balances a call to PrepareForChange(). | 114 // Balances a call to PrepareForChange(). |
112 void FinishChange(ChangeType change_type); | 115 void FinishChange(ChangeType change_type); |
113 | 116 |
114 // Returns true if the specified connection originated the current change. | 117 // Returns true if the specified connection originated the current change. |
115 bool IsChangeSource(TransportConnectionId connection_id) const { | 118 bool IsChangeSource(TransportConnectionId connection_id) const { |
116 return connection_id == change_source_; | 119 return connection_id == change_source_; |
117 } | 120 } |
118 | 121 |
119 // Overriden from NodeDelegate: | 122 // Overridden from NodeDelegate: |
120 virtual void OnNodeHierarchyChanged(const Node* node, | 123 virtual void OnNodeHierarchyChanged(const Node* node, |
121 const Node* new_parent, | 124 const Node* new_parent, |
122 const Node* old_parent) OVERRIDE; | 125 const Node* old_parent) OVERRIDE; |
123 virtual void OnNodeViewReplaced(const Node* node, | 126 virtual void OnNodeViewReplaced(const Node* node, |
124 const View* new_view, | 127 const View* new_view, |
125 const View* old_view) OVERRIDE; | 128 const View* old_view) OVERRIDE; |
126 | 129 |
127 Context context_; | 130 Context context_; |
128 | 131 |
129 // ID to use for next ViewManagerConnection. | 132 // ID to use for next ViewManagerConnection. |
(...skipping 16 matching lines...) Expand all Loading... |
146 Node root_; | 149 Node root_; |
147 | 150 |
148 DISALLOW_COPY_AND_ASSIGN(RootNodeManager); | 151 DISALLOW_COPY_AND_ASSIGN(RootNodeManager); |
149 }; | 152 }; |
150 | 153 |
151 } // namespace service | 154 } // namespace service |
152 } // namespace view_manager | 155 } // namespace view_manager |
153 } // namespace mojo | 156 } // namespace mojo |
154 | 157 |
155 #endif // MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ | 158 #endif // MOJO_SERVICES_VIEW_MANAGER_ROOT_NODE_MANAGER_H_ |
OLD | NEW |