Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / signin / chrome_signin_client_factory.cc
blob38de748059a475daa6b4a5f0e766d28cf6883b52
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/signin/chrome_signin_client_factory.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/signin_error_controller_factory.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 ChromeSigninClientFactory::ChromeSigninClientFactory()
12 : BrowserContextKeyedServiceFactory(
13 "ChromeSigninClient",
14 BrowserContextDependencyManager::GetInstance()) {
15 DependsOn(SigninErrorControllerFactory::GetInstance());
18 ChromeSigninClientFactory::~ChromeSigninClientFactory() {}
20 // static
21 SigninClient* ChromeSigninClientFactory::GetForProfile(Profile* profile) {
22 return static_cast<SigninClient*>(
23 GetInstance()->GetServiceForBrowserContext(profile, true));
26 // static
27 ChromeSigninClientFactory* ChromeSigninClientFactory::GetInstance() {
28 return Singleton<ChromeSigninClientFactory>::get();
31 KeyedService* ChromeSigninClientFactory::BuildServiceInstanceFor(
32 content::BrowserContext* context) const {
33 Profile* profile = static_cast<Profile*>(context);
34 ChromeSigninClient* client = new ChromeSigninClient(
35 profile, SigninErrorControllerFactory::GetForProfile(profile));
36 return client;