Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ios / chrome / browser / signin / signin_client_factory.cc
blob27ba4ceb2c79ef2aa906195676df3022c285fe69
1 // Copyright 2015 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 "ios/chrome/browser/signin/signin_client_factory.h"
7 #include "base/memory/singleton.h"
8 #include "components/keyed_service/core/service_access_type.h"
9 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
10 #include "ios/chrome/browser/signin/signin_client_impl.h"
11 #include "ios/chrome/browser/signin/signin_error_controller_factory.h"
12 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
14 // static
15 SigninClient* SigninClientFactory::GetForBrowserState(
16 ios::ChromeBrowserState* browser_state) {
17 return static_cast<SigninClient*>(
18 GetInstance()->GetServiceForBrowserState(browser_state, true));
21 // static
22 SigninClientFactory* SigninClientFactory::GetInstance() {
23 return Singleton<SigninClientFactory>::get();
26 SigninClientFactory::SigninClientFactory()
27 : BrowserStateKeyedServiceFactory(
28 "SigninClient",
29 BrowserStateDependencyManager::GetInstance()) {
30 DependsOn(ios::SigninErrorControllerFactory::GetInstance());
33 SigninClientFactory::~SigninClientFactory() {}
35 scoped_ptr<KeyedService> SigninClientFactory::BuildServiceInstanceFor(
36 web::BrowserState* context) const {
37 ios::ChromeBrowserState* chrome_browser_state =
38 ios::ChromeBrowserState::FromBrowserState(context);
39 return make_scoped_ptr(new SigninClientImpl(
40 chrome_browser_state,
41 ios::SigninErrorControllerFactory::GetForBrowserState(
42 chrome_browser_state)));