| 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, const Node* relative_node) const; |
| 113 bool CanDeleteNode(const NodeId& node_id) const; | 119 bool CanDeleteNode(const NodeId& node_id) const; |
| 114 bool CanDeleteView(const ViewId& view_id) const; | 120 bool CanDeleteView(const ViewId& view_id) const; |
| 115 bool CanSetView(const Node* node, const ViewId& view_id) const; | 121 bool CanSetView(const Node* node, const ViewId& view_id) const; |
| 116 bool CanGetNodeTree(const Node* node) const; | 122 bool CanGetNodeTree(const Node* node) const; |
| 117 bool CanEmbed(const mojo::Array<uint32_t>& node_ids) const; | 123 bool CanEmbed(const mojo::Array<uint32_t>& node_ids) const; |
| 118 | 124 |
| 119 // Deletes a node owned by this connection. Returns true on success. |source| | 125 // Deletes a node owned by this connection. Returns true on success. |source| |
| 120 // is the connection that originated the change. | 126 // is the connection that originated the change. |
| 121 bool DeleteNodeImpl(ViewManagerConnection* source, const NodeId& node_id); | 127 bool DeleteNodeImpl(ViewManagerConnection* source, const NodeId& node_id); |
| 122 | 128 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 virtual void DeleteNode(Id transport_node_id, | 169 virtual void DeleteNode(Id transport_node_id, |
| 164 const Callback<void(bool)>& callback) OVERRIDE; | 170 const Callback<void(bool)>& callback) OVERRIDE; |
| 165 virtual void AddNode(Id parent_id, | 171 virtual void AddNode(Id parent_id, |
| 166 Id child_id, | 172 Id child_id, |
| 167 Id server_change_id, | 173 Id server_change_id, |
| 168 const Callback<void(bool)>& callback) OVERRIDE; | 174 const Callback<void(bool)>& callback) OVERRIDE; |
| 169 virtual void RemoveNodeFromParent( | 175 virtual void RemoveNodeFromParent( |
| 170 Id node_id, | 176 Id node_id, |
| 171 Id server_change_id, | 177 Id server_change_id, |
| 172 const Callback<void(bool)>& callback) OVERRIDE; | 178 const Callback<void(bool)>& callback) OVERRIDE; |
| 179 virtual void ReorderNode(Id node_id, |
| 180 Id relative_node_id, |
| 181 OrderDirection direction, |
| 182 Id server_change_id, |
| 183 const Callback<void(bool)>& callback) OVERRIDE; |
| 173 virtual void GetNodeTree( | 184 virtual void GetNodeTree( |
| 174 Id node_id, | 185 Id node_id, |
| 175 const Callback<void(Array<INodePtr>)>& callback) OVERRIDE; | 186 const Callback<void(Array<INodePtr>)>& callback) OVERRIDE; |
| 176 virtual void CreateView(Id transport_view_id, | 187 virtual void CreateView(Id transport_view_id, |
| 177 const Callback<void(bool)>& callback) OVERRIDE; | 188 const Callback<void(bool)>& callback) OVERRIDE; |
| 178 virtual void DeleteView(Id transport_view_id, | 189 virtual void DeleteView(Id transport_view_id, |
| 179 const Callback<void(bool)>& callback) OVERRIDE; | 190 const Callback<void(bool)>& callback) OVERRIDE; |
| 180 virtual void SetView(Id transport_node_id, | 191 virtual void SetView(Id transport_node_id, |
| 181 Id transport_view_id, | 192 Id transport_view_id, |
| 182 const Callback<void(bool)>& callback) OVERRIDE; | 193 const Callback<void(bool)>& callback) OVERRIDE; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 253 |
| 243 #if defined(OS_WIN) | 254 #if defined(OS_WIN) |
| 244 #pragma warning(pop) | 255 #pragma warning(pop) |
| 245 #endif | 256 #endif |
| 246 | 257 |
| 247 } // namespace service | 258 } // namespace service |
| 248 } // namespace view_manager | 259 } // namespace view_manager |
| 249 } // namespace mojo | 260 } // namespace mojo |
| 250 | 261 |
| 251 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ | 262 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ |
| OLD | NEW |