OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "mojo/public/c/system/main.h" | 9 #include "mojo/public/c/system/main.h" |
10 #include "mojo/public/cpp/bindings/binding_set.h" | 10 #include "mojo/public/cpp/bindings/binding_set.h" |
11 #include "mojo/shell/public/cpp/application_runner.h" | 11 #include "services/shell/public/cpp/application_runner.h" |
12 #include "mojo/shell/public/cpp/shell_connection.h" | 12 #include "services/shell/public/cpp/shell_connection.h" |
13 #include "mojo/shell/public/interfaces/shell_client_factory.mojom.h" | 13 #include "services/shell/public/interfaces/shell_client_factory.mojom.h" |
14 #include "mojo/shell/tests/lifecycle/app_client.h" | 14 #include "services/shell/tests/lifecycle/app_client.h" |
15 #include "mojo/shell/tests/lifecycle/lifecycle_unittest.mojom.h" | 15 #include "services/shell/tests/lifecycle/lifecycle_unittest.mojom.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 class PackagedApp : public mojo::ShellClient, | 19 class PackagedApp : public mojo::ShellClient, |
20 public mojo::InterfaceFactory<LifecycleControl>, | 20 public mojo::InterfaceFactory<LifecycleControl>, |
21 public LifecycleControl { | 21 public LifecycleControl { |
22 public: | 22 public: |
23 using DestructCallback = base::Callback<void(PackagedApp*)>; | 23 using DestructCallback = base::Callback<void(PackagedApp*)>; |
24 | 24 |
25 PackagedApp(mojo::shell::mojom::ShellClientRequest request, | 25 PackagedApp(mojo::shell::mojom::ShellClientRequest request, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 }; | 143 }; |
144 | 144 |
145 } // namespace | 145 } // namespace |
146 | 146 |
147 MojoResult MojoMain(MojoHandle shell_handle) { | 147 MojoResult MojoMain(MojoHandle shell_handle) { |
148 Package* package = new Package; | 148 Package* package = new Package; |
149 mojo::ApplicationRunner runner(package); | 149 mojo::ApplicationRunner runner(package); |
150 package->set_runner(&runner); | 150 package->set_runner(&runner); |
151 return runner.Run(shell_handle); | 151 return runner.Run(shell_handle); |
152 } | 152 } |
OLD | NEW |