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 #ifndef MOJO_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_ | 5 #ifndef MOJO_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_ |
6 #define MOJO_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_ | 6 #define MOJO_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "mojo/public/cpp/bindings/binding_set.h" | 10 #include "mojo/public/cpp/bindings/binding_set.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 AppClient(); | 30 AppClient(); |
31 explicit AppClient(shell::mojom::ShellClientRequest request); | 31 explicit AppClient(shell::mojom::ShellClientRequest request); |
32 ~AppClient() override; | 32 ~AppClient() override; |
33 | 33 |
34 void set_runner(ApplicationRunner* runner) { | 34 void set_runner(ApplicationRunner* runner) { |
35 runner_ = runner; | 35 runner_ = runner; |
36 } | 36 } |
37 | 37 |
38 // ShellClient: | 38 // ShellClient: |
39 bool AcceptConnection(Connection* connection) override; | 39 bool AcceptConnection(Connection* connection) override; |
40 void ShellConnectionLost() override; | |
41 | 40 |
42 // InterfaceFactory<LifecycleControl>: | 41 // InterfaceFactory<LifecycleControl>: |
43 void Create(Connection* connection, LifecycleControlRequest request) override; | 42 void Create(Connection* connection, LifecycleControlRequest request) override; |
44 | 43 |
45 // LifecycleControl: | 44 // LifecycleControl: |
46 void Ping(const PingCallback& callback) override; | 45 void Ping(const PingCallback& callback) override; |
47 void GracefulQuit() override; | 46 void GracefulQuit() override; |
48 void Crash() override; | 47 void Crash() override; |
49 void CloseShellConnection() override; | 48 void CloseShellConnection() override; |
50 | 49 |
51 private: | 50 private: |
52 void BindingLost(); | 51 void BindingLost(); |
53 | 52 |
54 ApplicationRunner* runner_ = nullptr; | 53 ApplicationRunner* runner_ = nullptr; |
55 BindingSet<LifecycleControl> bindings_; | 54 BindingSet<LifecycleControl> bindings_; |
56 scoped_ptr<ShellConnection> connection_; | 55 scoped_ptr<ShellConnection> connection_; |
57 | 56 |
58 DISALLOW_COPY_AND_ASSIGN(AppClient); | 57 DISALLOW_COPY_AND_ASSIGN(AppClient); |
59 }; | 58 }; |
60 | 59 |
61 } // namespace test | 60 } // namespace test |
62 } // namespace shell | 61 } // namespace shell |
63 } // namespace mojo | 62 } // namespace mojo |
64 | 63 |
65 #endif // MOJO_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_ | 64 #endif // MOJO_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_ |
OLD | NEW |