| 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 "services/shell/tests/lifecycle/app_client.h" | 5 #include "services/shell/tests/lifecycle/app_client.h" |
| 6 | 6 |
| 7 #include "services/shell/public/cpp/interface_registry.h" |
| 7 #include "services/shell/public/cpp/service_context.h" | 8 #include "services/shell/public/cpp/service_context.h" |
| 8 | 9 |
| 9 namespace shell { | 10 namespace shell { |
| 10 namespace test { | 11 namespace test { |
| 11 | 12 |
| 12 AppClient::AppClient() {} | 13 AppClient::AppClient() {} |
| 13 AppClient::AppClient(shell::mojom::ServiceRequest request) | 14 AppClient::AppClient(shell::mojom::ServiceRequest request) |
| 14 : context_(new ServiceContext(this, std::move(request))) {} | 15 : context_(new ServiceContext(this, std::move(request))) {} |
| 15 AppClient::~AppClient() {} | 16 AppClient::~AppClient() {} |
| 16 | 17 |
| 17 bool AppClient::OnConnect(Connection* connection) { | 18 bool AppClient::OnConnect(const Identity& remote_identity, |
| 18 connection->AddInterface<LifecycleControl>(this); | 19 InterfaceRegistry* registry) { |
| 20 registry->AddInterface<LifecycleControl>(this); |
| 19 return true; | 21 return true; |
| 20 } | 22 } |
| 21 | 23 |
| 22 void AppClient::Create(const Identity& remote_identity, | 24 void AppClient::Create(const Identity& remote_identity, |
| 23 LifecycleControlRequest request) { | 25 LifecycleControlRequest request) { |
| 24 bindings_.AddBinding(this, std::move(request)); | 26 bindings_.AddBinding(this, std::move(request)); |
| 25 } | 27 } |
| 26 | 28 |
| 27 void AppClient::Ping(const PingCallback& callback) { | 29 void AppClient::Ping(const PingCallback& callback) { |
| 28 callback.Run(); | 30 callback.Run(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 49 | 51 |
| 50 void AppClient::BindingLost() { | 52 void AppClient::BindingLost() { |
| 51 if (bindings_.empty()) | 53 if (bindings_.empty()) |
| 52 GracefulQuit(); | 54 GracefulQuit(); |
| 53 } | 55 } |
| 54 | 56 |
| 55 } // namespace test | 57 } // namespace test |
| 56 } // namespace shell | 58 } // namespace shell |
| 57 | 59 |
| 58 | 60 |
| OLD | NEW |