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_VIEW_MANAGER_CONNECTION_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // necessary. | 79 // necessary. |
80 void ProcessNodeBoundsChanged(const Node* node, | 80 void ProcessNodeBoundsChanged(const Node* node, |
81 const gfx::Rect& old_bounds, | 81 const gfx::Rect& old_bounds, |
82 const gfx::Rect& new_bounds, | 82 const gfx::Rect& new_bounds, |
83 bool originated_change); | 83 bool originated_change); |
84 void ProcessNodeHierarchyChanged(const Node* node, | 84 void ProcessNodeHierarchyChanged(const Node* node, |
85 const Node* new_parent, | 85 const Node* new_parent, |
86 const Node* old_parent, | 86 const Node* old_parent, |
87 Id server_change_id, | 87 Id server_change_id, |
88 bool originated_change); | 88 bool originated_change); |
| 89 void ProcessNodeReorder(const Node* node, |
| 90 const Node* relative_node, |
| 91 OrderDirection direction, |
| 92 Id server_change_id, |
| 93 bool originated_change); |
89 void ProcessNodeViewReplaced(const Node* node, | 94 void ProcessNodeViewReplaced(const Node* node, |
90 const View* new_view, | 95 const View* new_view, |
91 const View* old_view, | 96 const View* old_view, |
92 bool originated_change); | 97 bool originated_change); |
93 void ProcessNodeDeleted(const NodeId& node, | 98 void ProcessNodeDeleted(const NodeId& node, |
94 Id server_change_id, | 99 Id server_change_id, |
95 bool originated_change); | 100 bool originated_change); |
96 void ProcessViewDeleted(const ViewId& view, bool originated_change); | 101 void ProcessViewDeleted(const ViewId& view, bool originated_change); |
97 void ProcessViewInputEvent(const View* view, const ui::Event* event); | 102 void ProcessViewInputEvent(const View* view, const ui::Event* event); |
98 | 103 |
99 // TODO(sky): move this to private section (currently can't because of | 104 // TODO(sky): move this to private section (currently can't because of |
100 // bindings). | 105 // bindings). |
101 // InterfaceImp overrides: | 106 // InterfaceImp overrides: |
102 virtual void OnConnectionError() MOJO_OVERRIDE; | 107 virtual void OnConnectionError() MOJO_OVERRIDE; |
103 | 108 |
104 private: | 109 private: |
105 typedef std::map<ConnectionSpecificId, Node*> NodeMap; | 110 typedef std::map<ConnectionSpecificId, Node*> NodeMap; |
106 typedef std::map<ConnectionSpecificId, View*> ViewMap; | 111 typedef std::map<ConnectionSpecificId, View*> ViewMap; |
107 typedef base::hash_set<Id> NodeIdSet; | 112 typedef base::hash_set<Id> NodeIdSet; |
108 | 113 |
109 // These functions return true if the corresponding mojom function is allowed | 114 // These functions return true if the corresponding mojom function is allowed |
110 // for this connection. | 115 // for this connection. |
111 bool CanRemoveNodeFromParent(const Node* node) const; | 116 bool CanRemoveNodeFromParent(const Node* node) const; |
112 bool CanAddNode(const Node* parent, const Node* child) const; | 117 bool CanAddNode(const Node* parent, const Node* child) const; |
| 118 bool CanReorderNode(const Node* node, |
| 119 const Node* relative_node, |
| 120 OrderDirection direction) const; |
113 bool CanDeleteNode(const NodeId& node_id) const; | 121 bool CanDeleteNode(const NodeId& node_id) const; |
114 bool CanDeleteView(const ViewId& view_id) const; | 122 bool CanDeleteView(const ViewId& view_id) const; |
115 bool CanSetView(const Node* node, const ViewId& view_id) const; | 123 bool CanSetView(const Node* node, const ViewId& view_id) const; |
116 bool CanGetNodeTree(const Node* node) const; | 124 bool CanGetNodeTree(const Node* node) const; |
117 bool CanEmbed(const mojo::Array<uint32_t>& node_ids) const; | 125 bool CanEmbed(const mojo::Array<uint32_t>& node_ids) const; |
118 | 126 |
119 // Deletes a node owned by this connection. Returns true on success. |source| | 127 // Deletes a node owned by this connection. Returns true on success. |source| |
120 // is the connection that originated the change. | 128 // is the connection that originated the change. |
121 bool DeleteNodeImpl(ViewManagerConnection* source, const NodeId& node_id); | 129 bool DeleteNodeImpl(ViewManagerConnection* source, const NodeId& node_id); |
122 | 130 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 virtual void DeleteNode(Id transport_node_id, | 171 virtual void DeleteNode(Id transport_node_id, |
164 const Callback<void(bool)>& callback) OVERRIDE; | 172 const Callback<void(bool)>& callback) OVERRIDE; |
165 virtual void AddNode(Id parent_id, | 173 virtual void AddNode(Id parent_id, |
166 Id child_id, | 174 Id child_id, |
167 Id server_change_id, | 175 Id server_change_id, |
168 const Callback<void(bool)>& callback) OVERRIDE; | 176 const Callback<void(bool)>& callback) OVERRIDE; |
169 virtual void RemoveNodeFromParent( | 177 virtual void RemoveNodeFromParent( |
170 Id node_id, | 178 Id node_id, |
171 Id server_change_id, | 179 Id server_change_id, |
172 const Callback<void(bool)>& callback) OVERRIDE; | 180 const Callback<void(bool)>& callback) OVERRIDE; |
| 181 virtual void ReorderNode(Id node_id, |
| 182 Id relative_node_id, |
| 183 OrderDirection direction, |
| 184 Id server_change_id, |
| 185 const Callback<void(bool)>& callback) OVERRIDE; |
173 virtual void GetNodeTree( | 186 virtual void GetNodeTree( |
174 Id node_id, | 187 Id node_id, |
175 const Callback<void(Array<INodePtr>)>& callback) OVERRIDE; | 188 const Callback<void(Array<INodePtr>)>& callback) OVERRIDE; |
176 virtual void CreateView(Id transport_view_id, | 189 virtual void CreateView(Id transport_view_id, |
177 const Callback<void(bool)>& callback) OVERRIDE; | 190 const Callback<void(bool)>& callback) OVERRIDE; |
178 virtual void DeleteView(Id transport_view_id, | 191 virtual void DeleteView(Id transport_view_id, |
179 const Callback<void(bool)>& callback) OVERRIDE; | 192 const Callback<void(bool)>& callback) OVERRIDE; |
180 virtual void SetView(Id transport_node_id, | 193 virtual void SetView(Id transport_node_id, |
181 Id transport_view_id, | 194 Id transport_view_id, |
182 const Callback<void(bool)>& callback) OVERRIDE; | 195 const Callback<void(bool)>& callback) OVERRIDE; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 255 |
243 #if defined(OS_WIN) | 256 #if defined(OS_WIN) |
244 #pragma warning(pop) | 257 #pragma warning(pop) |
245 #endif | 258 #endif |
246 | 259 |
247 } // namespace service | 260 } // namespace service |
248 } // namespace view_manager | 261 } // namespace view_manager |
249 } // namespace mojo | 262 } // namespace mojo |
250 | 263 |
251 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ | 264 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ |
OLD | NEW |