Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: mojo/services/view_manager/root_node_manager.cc

Issue 267293004: Wires up view manager to an actual display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/view_manager/root_node_manager.h ('k') | mojo/services/view_manager/root_view_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/root_node_manager.cc
diff --git a/mojo/services/view_manager/root_node_manager.cc b/mojo/services/view_manager/root_node_manager.cc
index 1a17ebd34ad85d3577e23995d8467de487db3b16..529306de24cee67b67cfa6e3b116f4bec0abd06a 100644
--- a/mojo/services/view_manager/root_node_manager.cc
+++ b/mojo/services/view_manager/root_node_manager.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "mojo/services/view_manager/view_manager_connection.h"
+#include "ui/aura/env.h"
namespace mojo {
namespace services {
@@ -17,6 +18,14 @@ const TransportConnectionSpecificNodeId kRootId = 1;
} // namespace
+RootNodeManager::Context::Context() {
+ // Pass in false as native viewport creates the PlatformEventSource.
+ aura::Env::CreateInstance(false);
+}
+
+RootNodeManager::Context::~Context() {
+}
+
RootNodeManager::ScopedChange::ScopedChange(ViewManagerConnection* connection,
RootNodeManager* root,
TransportChangeId change_id)
@@ -28,12 +37,15 @@ RootNodeManager::ScopedChange::~ScopedChange() {
root_->FinishChange();
}
-RootNodeManager::RootNodeManager()
+RootNodeManager::RootNodeManager(Shell* shell)
: next_connection_id_(1),
+ root_view_manager_(shell, this),
root_(this, NodeId(0, kRootId)) {
}
RootNodeManager::~RootNodeManager() {
+ // All the connections should have been destroyed.
+ DCHECK(connection_map_.empty());
}
TransportConnectionId RootNodeManager::GetAndAdvanceNextConnectionId() {
@@ -107,24 +119,11 @@ void RootNodeManager::FinishChange() {
change_.reset();
}
-void RootNodeManager::OnCreated() {
-}
-
-void RootNodeManager::OnDestroyed() {
-}
-
-void RootNodeManager::OnBoundsChanged(const Rect& bounds) {
-}
-
-void RootNodeManager::OnEvent(const Event& event,
- const mojo::Callback<void()>& callback) {
- callback.Run();
-}
-
void RootNodeManager::OnNodeHierarchyChanged(const NodeId& node,
const NodeId& new_parent,
const NodeId& old_parent) {
- NotifyNodeHierarchyChanged(node, new_parent, old_parent);
+ if (!root_view_manager_.in_setup())
+ NotifyNodeHierarchyChanged(node, new_parent, old_parent);
}
void RootNodeManager::OnNodeViewReplaced(const NodeId& node,
« no previous file with comments | « mojo/services/view_manager/root_node_manager.h ('k') | mojo/services/view_manager/root_view_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698