OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "mojo/public/cpp/application/application.h" | 8 #include "mojo/public/cpp/application/application.h" |
9 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 9 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 namespace examples { | 12 namespace examples { |
13 | 13 |
14 class DemoLauncher : public Application { | 14 class DemoLauncher : public Application { |
15 public: | 15 public: |
16 DemoLauncher() {} | 16 DemoLauncher() {} |
17 virtual ~DemoLauncher() {} | 17 virtual ~DemoLauncher() {} |
18 | 18 |
19 private: | 19 private: |
20 // Overridden from Application: | 20 // Overridden from Application: |
21 virtual void Initialize() MOJO_OVERRIDE { | 21 virtual void Initialize() MOJO_OVERRIDE { |
22 ConnectTo<view_manager::IViewManagerInit>("mojo:mojo_view_manager", | 22 ConnectTo<view_manager::IViewManagerInit>("mojo:mojo_view_manager", |
23 &view_manager_init_); | 23 &view_manager_init_); |
24 view_manager_init_->Connect("mojo:mojo_window_manager", | 24 view_manager_init_->EmbedRoot("mojo:mojo_window_manager", |
25 base::Bind(&DemoLauncher::OnConnect, | 25 base::Bind(&DemoLauncher::OnConnect, |
26 base::Unretained(this))); | 26 base::Unretained(this))); |
27 } | 27 } |
28 | 28 |
29 void OnConnect(bool success) {} | 29 void OnConnect(bool success) {} |
30 | 30 |
31 view_manager::IViewManagerInitPtr view_manager_init_; | 31 view_manager::IViewManagerInitPtr view_manager_init_; |
32 | 32 |
33 DISALLOW_COPY_AND_ASSIGN(DemoLauncher); | 33 DISALLOW_COPY_AND_ASSIGN(DemoLauncher); |
34 }; | 34 }; |
35 | 35 |
36 } // namespace examples | 36 } // namespace examples |
37 | 37 |
38 // static | 38 // static |
39 Application* Application::Create() { | 39 Application* Application::Create() { |
40 return new examples::DemoLauncher; | 40 return new examples::DemoLauncher; |
41 } | 41 } |
42 | 42 |
43 } // namespace mojo | 43 } // namespace mojo |
OLD | NEW |