OLD | NEW |
---|---|
(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/basictypes.h" | |
6 #include "base/bind.h" | |
7 #include "base/run_loop.h" | |
8 #include "mojo/public/cpp/application/application.h" | |
9 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | |
10 | |
11 namespace mojo { | |
12 namespace examples { | |
13 | |
14 class DemoLauncher : public Application { | |
15 public: | |
16 DemoLauncher() {} | |
17 virtual ~DemoLauncher() {} | |
18 | |
19 private: | |
20 // Overridden from Application: | |
21 virtual void Initialize() MOJO_OVERRIDE { | |
22 ConnectTo<view_manager::IViewManagerInit>("mojo:mojo_view_manager", | |
23 &view_manager_init_); | |
24 view_manager_init_->Connect("mojo:mojo_window_manager", | |
25 base::Bind(&DemoLauncher::OnConnect, | |
26 base::Unretained(this))); | |
27 base::RunLoop().Run(); | |
sky
2014/06/02 19:14:59
Are you sure you need this?
| |
28 } | |
29 | |
30 void OnConnect(bool success) {} | |
31 | |
32 view_manager::IViewManagerInitPtr view_manager_init_; | |
33 | |
34 DISALLOW_COPY_AND_ASSIGN(DemoLauncher); | |
35 }; | |
36 | |
37 } // namespace examples | |
38 | |
39 // static | |
40 Application* Application::Create() { | |
41 return new examples::DemoLauncher; | |
42 } | |
43 | |
44 } // namespace mojo | |
OLD | NEW |