| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 14 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
| 15 #include "mojo/services/view_manager/ids.h" | 15 #include "mojo/services/view_manager/ids.h" |
| 16 #include "mojo/services/view_manager/node_delegate.h" | 16 #include "mojo/services/view_manager/node_delegate.h" |
| 17 #include "mojo/services/view_manager/view_manager_export.h" | 17 #include "mojo/services/view_manager/view_manager_export.h" |
| 18 | 18 |
| 19 namespace gfx { |
| 20 class Rect; |
| 21 } |
| 22 |
| 19 namespace mojo { | 23 namespace mojo { |
| 20 namespace view_manager { | 24 namespace view_manager { |
| 21 namespace service { | 25 namespace service { |
| 22 | 26 |
| 23 class Node; | 27 class Node; |
| 24 class RootNodeManager; | 28 class RootNodeManager; |
| 25 class View; | 29 class View; |
| 26 | 30 |
| 27 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 28 // Equivalent of NON_EXPORTED_BASE which does not work with the template snafu | 32 // Equivalent of NON_EXPORTED_BASE which does not work with the template snafu |
| (...skipping 24 matching lines...) Expand all Loading... |
| 53 // Returns the View with the specified id. | 57 // Returns the View with the specified id. |
| 54 View* GetView(const ViewId& id) { | 58 View* GetView(const ViewId& id) { |
| 55 return const_cast<View*>( | 59 return const_cast<View*>( |
| 56 const_cast<const ViewManagerConnection*>(this)->GetView(id)); | 60 const_cast<const ViewManagerConnection*>(this)->GetView(id)); |
| 57 } | 61 } |
| 58 const View* GetView(const ViewId& id) const; | 62 const View* GetView(const ViewId& id) const; |
| 59 | 63 |
| 60 // The following methods are invoked after the corresponding change has been | 64 // The following methods are invoked after the corresponding change has been |
| 61 // processed. They do the appropriate bookkeeping and update the client as | 65 // processed. They do the appropriate bookkeeping and update the client as |
| 62 // necessary. | 66 // necessary. |
| 67 void ProcessNodeBoundsChanged(const Node* node, |
| 68 const gfx::Rect& old_bounds, |
| 69 const gfx::Rect& new_bounds, |
| 70 bool originated_change); |
| 63 void ProcessNodeHierarchyChanged(const Node* node, | 71 void ProcessNodeHierarchyChanged(const Node* node, |
| 64 const Node* new_parent, | 72 const Node* new_parent, |
| 65 const Node* old_parent, | 73 const Node* old_parent, |
| 66 TransportChangeId server_change_id, | 74 TransportChangeId server_change_id, |
| 67 bool originated_change); | 75 bool originated_change); |
| 68 void ProcessNodeViewReplaced(const Node* node, | 76 void ProcessNodeViewReplaced(const Node* node, |
| 69 const View* new_view, | 77 const View* new_view, |
| 70 const View* old_view, | 78 const View* old_view, |
| 71 bool originated_change); | 79 bool originated_change); |
| 72 void ProcessNodeDeleted(const NodeId& node, | 80 void ProcessNodeDeleted(const NodeId& node, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 virtual void SetView(TransportNodeId transport_node_id, | 158 virtual void SetView(TransportNodeId transport_node_id, |
| 151 TransportViewId transport_view_id, | 159 TransportViewId transport_view_id, |
| 152 const Callback<void(bool)>& callback) OVERRIDE; | 160 const Callback<void(bool)>& callback) OVERRIDE; |
| 153 virtual void SetViewContents(TransportViewId view_id, | 161 virtual void SetViewContents(TransportViewId view_id, |
| 154 ScopedSharedBufferHandle buffer, | 162 ScopedSharedBufferHandle buffer, |
| 155 uint32_t buffer_size) OVERRIDE; | 163 uint32_t buffer_size) OVERRIDE; |
| 156 virtual void SetRoots( | 164 virtual void SetRoots( |
| 157 TransportConnectionId connection_id, | 165 TransportConnectionId connection_id, |
| 158 const Array<TransportNodeId>& transport_node_ids, | 166 const Array<TransportNodeId>& transport_node_ids, |
| 159 const Callback<void(bool)>& callback) OVERRIDE; | 167 const Callback<void(bool)>& callback) OVERRIDE; |
| 168 virtual void SetNodeBounds(TransportNodeId node_id, |
| 169 const Rect& bounds, |
| 170 const Callback<void(bool)>& callback) OVERRIDE; |
| 160 | 171 |
| 161 // Overridden from NodeDelegate: | 172 // Overridden from NodeDelegate: |
| 162 virtual void OnNodeHierarchyChanged(const Node* node, | 173 virtual void OnNodeHierarchyChanged(const Node* node, |
| 163 const Node* new_parent, | 174 const Node* new_parent, |
| 164 const Node* old_parent) OVERRIDE; | 175 const Node* old_parent) OVERRIDE; |
| 165 virtual void OnNodeViewReplaced(const Node* node, | 176 virtual void OnNodeViewReplaced(const Node* node, |
| 166 const View* new_view, | 177 const View* new_view, |
| 167 const View* old_view) OVERRIDE; | 178 const View* old_view) OVERRIDE; |
| 168 | 179 |
| 169 RootNodeManager* root_node_manager_; | 180 RootNodeManager* root_node_manager_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 192 | 203 |
| 193 #if defined(OS_WIN) | 204 #if defined(OS_WIN) |
| 194 #pragma warning(pop) | 205 #pragma warning(pop) |
| 195 #endif | 206 #endif |
| 196 | 207 |
| 197 } // namespace service | 208 } // namespace service |
| 198 } // namespace view_manager | 209 } // namespace view_manager |
| 199 } // namespace mojo | 210 } // namespace mojo |
| 200 | 211 |
| 201 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ | 212 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_CONNECTION_H_ |
| OLD | NEW |