Index: mojo/services/view_manager/root_node_manager.h |
diff --git a/mojo/services/view_manager/root_node_manager.h b/mojo/services/view_manager/root_node_manager.h |
index eee4c8c014ded7e5b04837c35ec098f893e2ce06..91aa8e7cd9024b53b5dbb3725cd31c675b86fcc2 100644 |
--- a/mojo/services/view_manager/root_node_manager.h |
+++ b/mojo/services/view_manager/root_node_manager.h |
@@ -8,13 +8,16 @@ |
#include <map> |
#include "base/basictypes.h" |
-#include "mojo/services/native_viewport/native_viewport.mojom.h" |
#include "mojo/services/view_manager/ids.h" |
#include "mojo/services/view_manager/node.h" |
#include "mojo/services/view_manager/node_delegate.h" |
+#include "mojo/services/view_manager/root_view_manager.h" |
#include "mojo/services/view_manager/view_manager_export.h" |
namespace mojo { |
+ |
+class Shell; |
+ |
namespace services { |
namespace view_manager { |
@@ -23,9 +26,7 @@ class ViewManagerConnection; |
// RootNodeManager is responsible for managing the set of ViewManagerConnections |
// as well as providing the root of the node hierarchy. |
-class MOJO_VIEW_MANAGER_EXPORT RootNodeManager |
- : public NativeViewportClient, |
- public NodeDelegate { |
+class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate { |
public: |
// Create when a ViewManagerConnection is about to make a change. Ensures |
// clients are notified of the correct change id. |
@@ -42,7 +43,7 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager |
DISALLOW_COPY_AND_ASSIGN(ScopedChange); |
}; |
- RootNodeManager(); |
+ explicit RootNodeManager(Shell* shell); |
virtual ~RootNodeManager(); |
// Returns the id for the next ViewManagerConnection. |
@@ -60,6 +61,8 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager |
// Returns the View identified by |id|. |
View* GetView(const ViewId& id); |
+ Node* root() { return &root_; } |
+ |
// These functions trivially delegate to all ViewManagerConnections, which in |
// term notify their clients. |
void NotifyNodeHierarchyChanged(const NodeId& node, |
@@ -70,6 +73,12 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager |
const ViewId& old_view_id); |
private: |
+ // Used to setup any static state needed by RootNodeManager. |
+ struct Context { |
+ Context(); |
+ ~Context(); |
+ }; |
+ |
// Tracks a change. |
struct Change { |
Change(TransportConnectionId connection_id, TransportChangeId change_id) |
@@ -95,13 +104,6 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager |
// Balances a call to PrepareForChange(). |
void FinishChange(); |
- // Overridden from NativeViewportClient: |
- virtual void OnCreated() OVERRIDE; |
- virtual void OnDestroyed() OVERRIDE; |
- virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE; |
- virtual void OnEvent(const Event& event, |
- const mojo::Callback<void()>& callback) OVERRIDE; |
- |
// Overriden from NodeDelegate: |
virtual void OnNodeHierarchyChanged(const NodeId& node, |
const NodeId& new_parent, |
@@ -110,18 +112,22 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager |
const ViewId& new_view_id, |
const ViewId& old_view_id) OVERRIDE; |
+ Context context_; |
+ |
// ID to use for next ViewManagerConnection. |
TransportConnectionId next_connection_id_; |
// Set of ViewManagerConnections. |
ConnectionMap connection_map_; |
- // Root node. |
- Node root_; |
- |
// If non-null we're processing a change. |
scoped_ptr<Change> change_; |
+ RootViewManager root_view_manager_; |
+ |
+ // Root node. |
+ Node root_; |
+ |
DISALLOW_COPY_AND_ASSIGN(RootNodeManager); |
}; |