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