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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/bind.h"
6 #include "mojo/public/cpp/application/application_delegate.h"
7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
9
10 namespace examples {
11 namespace {
12 void ConnectCallback(bool success) {}
13 } // namespace
14
15 // This application starts the view manager, embeds the window manager and then
16 // starts another app (wm_flow_app) which also connects to the view manager and
17 // asks to be embedded without context.
18 class WMFlowInit : public mojo::ApplicationDelegate {
19 public:
20 WMFlowInit() {}
21 virtual ~WMFlowInit() {}
22
23 private:
24 // Overridden from Application:
25 virtual void Initialize(mojo::ApplicationImpl* app) MOJO_OVERRIDE {
26 app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_);
27 view_manager_init_->Embed("mojo:mojo_wm_flow_wm",
28 base::Bind(&ConnectCallback));
29 app->ConnectToApplication("mojo:mojo_wm_flow_app");
30 }
31
32 void OnConnect(bool success) {}
33
34 mojo::view_manager::ViewManagerInitServicePtr view_manager_init_;
35
36 DISALLOW_COPY_AND_ASSIGN(WMFlowInit);
37 };
38
39 } // namespace examples
40
41 namespace mojo {
42
43 // static
44 ApplicationDelegate* ApplicationDelegate::Create() {
45 return new examples::WMFlowInit;
46 }
47
48 } // namespace
OLDNEW
« 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