summaryrefslogtreecommitdiffstats
path: root/mojo/services/view_manager/root_node_manager.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-09 10:21:41 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-09 10:21:41 +0000
commit56cf6ee923c8a4c69c09812343e3311cf18de69d (patch)
tree6ab780f49954426288964d17969b3c4f9894046c /mojo/services/view_manager/root_node_manager.h
parent67f26654df13969da4691ead936bbd963b0ae835 (diff)
downloadchromium_src-56cf6ee923c8a4c69c09812343e3311cf18de69d.zip
chromium_src-56cf6ee923c8a4c69c09812343e3311cf18de69d.tar.gz
chromium_src-56cf6ee923c8a4c69c09812343e3311cf18de69d.tar.bz2
Wires up view manager to an actual display
Adds a SetViewContents to exercise this. BUG=365012 TEST=none R=ben@chromium.org Review URL: https://codereview.chromium.org/267293004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/services/view_manager/root_node_manager.h')
-rw-r--r--mojo/services/view_manager/root_node_manager.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/mojo/services/view_manager/root_node_manager.h b/mojo/services/view_manager/root_node_manager.h
index eee4c8c..91aa8e7 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);
};