summaryrefslogtreecommitdiff
path: root/chromium/services/identity/identity_service.cc
blob: 95e564396a58743574fd6f438533a969c33aee40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/identity/identity_service.h"

#include "services/identity/identity_manager.h"
#include "services/service_manager/public/cpp/service_context.h"

namespace identity {

IdentityService::IdentityService(SigninManagerBase* signin_manager)
    : signin_manager_(signin_manager) {
  registry_.AddInterface<mojom::IdentityManager>(
      base::Bind(&IdentityService::Create, base::Unretained(this)));
}

IdentityService::~IdentityService() {}

void IdentityService::OnStart() {}

void IdentityService::OnBindInterface(
    const service_manager::BindSourceInfo& source_info,
    const std::string& interface_name,
    mojo::ScopedMessagePipeHandle interface_pipe) {
  registry_.BindInterface(source_info, interface_name,
                          std::move(interface_pipe));
}

void IdentityService::Create(const service_manager::BindSourceInfo& source_info,
                             mojom::IdentityManagerRequest request) {
  IdentityManager::Create(std::move(request), signin_manager_);
}

}  // namespace identity