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

Unified Diff: mojo/examples/wm_flow/init/init.cc

Issue 400113005: A new WM bootstrap flow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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/examples/wm_flow/app/app.cc ('k') | mojo/examples/wm_flow/wm/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/wm_flow/init/init.cc
diff --git a/mojo/examples/wm_flow/init/init.cc b/mojo/examples/wm_flow/init/init.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da543054adea85d91e95226c9908e1fd0e8d52a6
--- /dev/null
+++ b/mojo/examples/wm_flow/init/init.cc
@@ -0,0 +1,48 @@
+// 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/bind.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
+
+namespace examples {
+namespace {
+void ConnectCallback(bool success) {}
+} // namespace
+
+// This application starts the view manager, embeds the window manager and then
+// starts another app (wm_flow_app) which also connects to the view manager and
+// asks to be embedded without context.
+class WMFlowInit : public mojo::ApplicationDelegate {
+ public:
+ WMFlowInit() {}
+ virtual ~WMFlowInit() {}
+
+ private:
+ // Overridden from Application:
+ virtual void Initialize(mojo::ApplicationImpl* app) MOJO_OVERRIDE {
+ app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_);
+ view_manager_init_->Embed("mojo:mojo_wm_flow_wm",
+ base::Bind(&ConnectCallback));
+ app->ConnectToApplication("mojo:mojo_wm_flow_app");
+ }
+
+ void OnConnect(bool success) {}
+
+ mojo::view_manager::ViewManagerInitServicePtr view_manager_init_;
+
+ DISALLOW_COPY_AND_ASSIGN(WMFlowInit);
+};
+
+} // namespace examples
+
+namespace mojo {
+
+// static
+ApplicationDelegate* ApplicationDelegate::Create() {
+ return new examples::WMFlowInit;
+}
+
+} // namespace
« no previous file with comments | « mojo/examples/wm_flow/app/app.cc ('k') | mojo/examples/wm_flow/wm/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698