| 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_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ |
| 6 #define SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ | 6 #define SERVICES_SERVICE_MANAGER_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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "mojo/public/cpp/bindings/binding_set.h" | 12 #include "mojo/public/cpp/bindings/binding_set.h" |
| 13 #include "services/service_manager/public/cpp/interface_factory.h" | 13 #include "services/service_manager/public/cpp/interface_factory.h" |
| 14 #include "services/service_manager/public/cpp/service.h" | 14 #include "services/service_manager/public/cpp/service.h" |
| 15 #include "services/service_manager/public/cpp/service_runner.h" | 15 #include "services/service_manager/public/cpp/service_runner.h" |
| 16 #include "services/service_manager/public/interfaces/service.mojom.h" | 16 #include "services/service_manager/public/interfaces/service.mojom.h" |
| 17 #include "services/service_manager/tests/lifecycle/lifecycle_unittest.mojom.h" | 17 #include "services/service_manager/tests/lifecycle/lifecycle_unittest.mojom.h" |
| 18 | 18 |
| 19 using LifecycleControl = shell::test::mojom::LifecycleControl; | 19 using LifecycleControl = service_manager::test::mojom::LifecycleControl; |
| 20 using LifecycleControlRequest = shell::test::mojom::LifecycleControlRequest; | 20 using LifecycleControlRequest = |
| 21 service_manager::test::mojom::LifecycleControlRequest; |
| 21 | 22 |
| 22 namespace shell { | 23 namespace service_manager { |
| 23 class ServiceContext; | 24 class ServiceContext; |
| 24 | 25 |
| 25 namespace test { | 26 namespace test { |
| 26 | 27 |
| 27 class AppClient : public Service, | 28 class AppClient : public Service, |
| 28 public InterfaceFactory<LifecycleControl>, | 29 public InterfaceFactory<LifecycleControl>, |
| 29 public LifecycleControl { | 30 public LifecycleControl { |
| 30 public: | 31 public: |
| 31 AppClient(); | 32 AppClient(); |
| 32 explicit AppClient(shell::mojom::ServiceRequest request); | 33 explicit AppClient(service_manager::mojom::ServiceRequest request); |
| 33 ~AppClient() override; | 34 ~AppClient() override; |
| 34 | 35 |
| 35 void set_runner(ServiceRunner* runner) { | 36 void set_runner(ServiceRunner* runner) { |
| 36 runner_ = runner; | 37 runner_ = runner; |
| 37 } | 38 } |
| 38 | 39 |
| 39 // Service: | 40 // Service: |
| 40 bool OnConnect(const Identity& remote_identity, | 41 bool OnConnect(const Identity& remote_identity, |
| 41 InterfaceRegistry* registry) override; | 42 InterfaceRegistry* registry) override; |
| 42 | 43 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 54 void BindingLost(); | 55 void BindingLost(); |
| 55 | 56 |
| 56 ServiceRunner* runner_ = nullptr; | 57 ServiceRunner* runner_ = nullptr; |
| 57 mojo::BindingSet<LifecycleControl> bindings_; | 58 mojo::BindingSet<LifecycleControl> bindings_; |
| 58 std::unique_ptr<ServiceContext> context_; | 59 std::unique_ptr<ServiceContext> context_; |
| 59 | 60 |
| 60 DISALLOW_COPY_AND_ASSIGN(AppClient); | 61 DISALLOW_COPY_AND_ASSIGN(AppClient); |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace test | 64 } // namespace test |
| 64 } // namespace shell | 65 } // namespace service_manager |
| 65 | 66 |
| 66 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ | 67 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ |
| OLD | NEW |