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

Unified Diff: mojo/examples/demo_launcher/demo_launcher.cc

Issue 303163005: Embedding demo in View manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 | « no previous file | mojo/examples/embedded_app/embedded_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/demo_launcher/demo_launcher.cc
diff --git a/mojo/examples/demo_launcher/demo_launcher.cc b/mojo/examples/demo_launcher/demo_launcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..def2e4d457819c81916928e731eddb97cbc658f1
--- /dev/null
+++ b/mojo/examples/demo_launcher/demo_launcher.cc
@@ -0,0 +1,43 @@
+// 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 "base/run_loop.h"
+#include "mojo/public/cpp/application/application.h"
+#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
+
+namespace mojo {
+namespace examples {
+
+class DemoLauncher : public Application {
+ public:
+ DemoLauncher() {}
+ virtual ~DemoLauncher() {}
+
+ private:
+ // Overridden from Application:
+ virtual void Initialize() MOJO_OVERRIDE {
+ ConnectTo<view_manager::IViewManagerInit>("mojo:mojo_view_manager",
+ &view_manager_init_);
+ view_manager_init_->Connect("mojo:mojo_window_manager",
+ base::Bind(&DemoLauncher::OnConnect,
+ base::Unretained(this)));
+ }
+
+ void OnConnect(bool success) {}
+
+ view_manager::IViewManagerInitPtr view_manager_init_;
+
+ DISALLOW_COPY_AND_ASSIGN(DemoLauncher);
+};
+
+} // namespace examples
+
+// static
+Application* Application::Create() {
+ return new examples::DemoLauncher;
+}
+
+} // namespace mojo
« no previous file with comments | « no previous file | mojo/examples/embedded_app/embedded_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698