| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/identity/identity_service.h" | 5 #include "services/identity/identity_service.h" |
| 6 | 6 |
| 7 #include "services/identity/identity_manager.h" | 7 #include "services/identity/identity_manager.h" |
| 8 #include "services/service_manager/public/cpp/connection.h" | |
| 9 #include "services/service_manager/public/cpp/service_context.h" | 8 #include "services/service_manager/public/cpp/service_context.h" |
| 10 | 9 |
| 11 namespace identity { | 10 namespace identity { |
| 12 | 11 |
| 13 IdentityService::IdentityService(SigninManagerBase* signin_manager) | 12 IdentityService::IdentityService(SigninManagerBase* signin_manager) |
| 14 : signin_manager_(signin_manager) { | 13 : signin_manager_(signin_manager) { |
| 15 registry_.AddInterface<mojom::IdentityManager>(this); | 14 registry_.AddInterface<mojom::IdentityManager>(this); |
| 16 } | 15 } |
| 17 | 16 |
| 18 IdentityService::~IdentityService() {} | 17 IdentityService::~IdentityService() {} |
| 19 | 18 |
| 20 void IdentityService::OnStart() {} | 19 void IdentityService::OnStart() {} |
| 21 | 20 |
| 22 void IdentityService::OnBindInterface( | 21 void IdentityService::OnBindInterface( |
| 23 const service_manager::ServiceInfo& source_info, | 22 const service_manager::ServiceInfo& source_info, |
| 24 const std::string& interface_name, | 23 const std::string& interface_name, |
| 25 mojo::ScopedMessagePipeHandle interface_pipe) { | 24 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 26 registry_.BindInterface(source_info.identity, interface_name, | 25 registry_.BindInterface(source_info.identity, interface_name, |
| 27 std::move(interface_pipe)); | 26 std::move(interface_pipe)); |
| 28 } | 27 } |
| 29 | 28 |
| 30 void IdentityService::Create(const service_manager::Identity& remote_identity, | 29 void IdentityService::Create(const service_manager::Identity& remote_identity, |
| 31 mojom::IdentityManagerRequest request) { | 30 mojom::IdentityManagerRequest request) { |
| 32 IdentityManager::Create(std::move(request), signin_manager_); | 31 IdentityManager::Create(std::move(request), signin_manager_); |
| 33 } | 32 } |
| 34 | 33 |
| 35 } // namespace identity | 34 } // namespace identity |
| OLD | NEW |