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

Unified Diff: mojo/examples/aura_demo/view_manager_init.cc

Issue 313483002: Gets aura_demo working with the view_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge 2 master and fix windows 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
Index: mojo/examples/aura_demo/view_manager_init.cc
diff --git a/mojo/examples/aura_demo/view_manager_init.cc b/mojo/examples/aura_demo/view_manager_init.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fd90e1c7ad4447230584ffc2bafd4bda6be7e42f
--- /dev/null
+++ b/mojo/examples/aura_demo/view_manager_init.cc
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/basictypes.h"
+#include "base/bind.h"
+#include "mojo/public/cpp/application/application.h"
+#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
+
+namespace mojo {
+namespace examples {
+
+// ViewManagerInit is responsible for establishing the initial connection to
+// the view manager. When established it loads |mojo_aura_demo|.
+class ViewManagerInit : public Application {
+ public:
+ ViewManagerInit() {}
+ virtual ~ViewManagerInit() {}
+
+ virtual void Initialize() OVERRIDE {
+ ConnectTo("mojo:mojo_view_manager", &view_manager_init_);
+ view_manager_init_->Connect("mojo:mojo_aura_demo",
+ base::Bind(&ViewManagerInit::DidConnect,
+ base::Unretained(this)));
+ }
+
+ private:
+ void DidConnect(bool result) {
+ DCHECK(result);
+ VLOG(1) << "ViewManagerInit::DidConnection result=" << result;
+ }
+
+ view_manager::IViewManagerInitPtr view_manager_init_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewManagerInit);
+};
+
+} // namespace examples
+
+// static
+Application* Application::Create() {
+ return new examples::ViewManagerInit();
+}
+
+} // namespace mojo
+
« no previous file with comments | « mojo/examples/aura_demo/context_factory_view_manager.cc ('k') | mojo/examples/aura_demo/window_tree_host_view_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698