| Index: mojo/services/view_manager/view_manager_connection.h
|
| diff --git a/mojo/services/view_manager/view_manager_connection.h b/mojo/services/view_manager/view_manager_connection.h
|
| index a03ef6ae0b3cbf9f6d6a2b59104c34c78193d0fa..974e0332c2848554f79d6cbe69d223d99f102e3d 100644
|
| --- a/mojo/services/view_manager/view_manager_connection.h
|
| +++ b/mojo/services/view_manager/view_manager_connection.h
|
| @@ -19,6 +19,7 @@ namespace view_manager {
|
|
|
| class Node;
|
| class RootNodeManager;
|
| +class View;
|
|
|
| // Manages a connection from the client.
|
| class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
|
| @@ -36,21 +37,49 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
|
| ServiceConnector<ViewManagerConnection, RootNodeManager>* service_factory,
|
| ScopedMessagePipeHandle client_handle);
|
|
|
| - // Returns the Node by id.
|
| + // Returns the Node with the specified id.
|
| Node* GetNode(const NodeId& id);
|
|
|
| + // Returns the View with the specified id.
|
| + View* GetView(const ViewId& id);
|
| +
|
| // Notifies the client of a hierarchy change.
|
| void NotifyNodeHierarchyChanged(const NodeId& node,
|
| const NodeId& new_parent,
|
| const NodeId& old_parent,
|
| int32_t change_id);
|
| + void NotifyNodeViewReplaced(const NodeId& node,
|
| + const ViewId& new_view_id,
|
| + const ViewId& old_view_id,
|
| + int32_t change_id);
|
|
|
| private:
|
| typedef std::map<uint16_t, Node*> NodeMap;
|
| + typedef std::map<uint16_t, View*> ViewMap;
|
| +
|
| + // Deletes a node owned by this connection. Returns true on success. |source|
|
| + // is the connection that originated the change.
|
| + bool DeleteNodeImpl(ViewManagerConnection* source,
|
| + const NodeId& node_id,
|
| + int32_t change_id);
|
| +
|
| + // Deletes a view owned by this connection. Returns true on success. |source|
|
| + // is the connection that originated the change.
|
| + bool DeleteViewImpl(ViewManagerConnection* source,
|
| + const ViewId& view_id,
|
| + int32_t change_id);
|
| +
|
| + // Sets the view associated with a node.
|
| + bool SetViewImpl(const NodeId& node_id,
|
| + const ViewId& view_id,
|
| + int32_t change_id);
|
|
|
| // Overridden from ViewManager:
|
| virtual void CreateNode(uint16_t node_id,
|
| const Callback<void(bool)>& callback) OVERRIDE;
|
| + virtual void DeleteNode(uint32_t transport_node_id,
|
| + int32_t change_id,
|
| + const mojo::Callback<void(bool)>& callback) OVERRIDE;
|
| virtual void AddNode(uint32_t parent_id,
|
| uint32_t child_id,
|
| int32_t change_id,
|
| @@ -59,11 +88,23 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
|
| uint32_t node_id,
|
| int32_t change_id,
|
| const Callback<void(bool)>& callback) OVERRIDE;
|
| + virtual void CreateView(uint16_t view_id,
|
| + const mojo::Callback<void(bool)>& callback) OVERRIDE;
|
| + virtual void DeleteView(uint32_t transport_view_id,
|
| + int32_t change_id,
|
| + const mojo::Callback<void(bool)>& callback) OVERRIDE;
|
| + virtual void SetView(uint32_t transport_node_id,
|
| + uint32_t transport_view_id,
|
| + int32_t change_id,
|
| + const mojo::Callback<void(bool)>& callback) OVERRIDE;
|
|
|
| // Overriden from NodeDelegate:
|
| virtual void OnNodeHierarchyChanged(const NodeId& node,
|
| const NodeId& new_parent,
|
| const NodeId& old_parent) OVERRIDE;
|
| + virtual void OnNodeViewReplaced(const NodeId& node,
|
| + const ViewId& new_view_id,
|
| + const ViewId& old_view_id) OVERRIDE;
|
|
|
| // Id of this connection as assigned by RootNodeManager. Assigned in
|
| // Initialize().
|
| @@ -71,6 +112,8 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
|
|
|
| NodeMap node_map_;
|
|
|
| + ViewMap view_map_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ViewManagerConnection);
|
| };
|
|
|
|
|