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_connection.h" | 8 #include "mojo/public/cpp/application/application_connection.h" |
9 #include "mojo/public/cpp/application/application_delegate.h" | 9 #include "mojo/public/cpp/application/application_delegate.h" |
| 10 #include "mojo/public/cpp/application/application_export.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 11 #include "mojo/public/cpp/application/application_impl.h" |
| 12 #include "mojo/public/cpp/application/application_runner_chromium.h" |
11 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 13 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
12 | 14 |
13 namespace mojo { | 15 namespace mojo { |
14 namespace examples { | 16 namespace examples { |
15 | 17 |
16 class DemoLauncher : public ApplicationDelegate { | 18 class DemoLauncher : public ApplicationDelegate { |
17 public: | 19 public: |
18 DemoLauncher() {} | 20 DemoLauncher() {} |
19 virtual ~DemoLauncher() {} | 21 virtual ~DemoLauncher() {} |
20 | 22 |
(...skipping 11 matching lines...) Expand all Loading... |
32 } | 34 } |
33 | 35 |
34 void OnConnect(bool success) {} | 36 void OnConnect(bool success) {} |
35 | 37 |
36 ViewManagerInitServicePtr view_manager_init_; | 38 ViewManagerInitServicePtr view_manager_init_; |
37 | 39 |
38 DISALLOW_COPY_AND_ASSIGN(DemoLauncher); | 40 DISALLOW_COPY_AND_ASSIGN(DemoLauncher); |
39 }; | 41 }; |
40 | 42 |
41 } // namespace examples | 43 } // namespace examples |
| 44 } // namespace mojo |
42 | 45 |
43 // static | 46 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( |
44 ApplicationDelegate* ApplicationDelegate::Create() { | 47 MojoHandle shell_handle) { |
45 return new examples::DemoLauncher; | 48 mojo::ApplicationRunnerChromium app; |
| 49 app.take_delegate(make_scoped_delegate(new mojo::examples::DemoLauncher)); |
| 50 return app.Run(shell_handle); |
46 } | 51 } |
47 | |
48 } // namespace mojo | |
OLD | NEW |