OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "ios/chrome/browser/signin/about_signin_internals_factory.h" | 5 #include "ios/chrome/browser/signin/about_signin_internals_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 8 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
9 #include "components/signin/core/browser/about_signin_internals.h" | 9 #include "components/signin/core/browser/about_signin_internals.h" |
10 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" | 10 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // static | 34 // static |
35 AboutSigninInternals* AboutSigninInternalsFactory::GetForBrowserState( | 35 AboutSigninInternals* AboutSigninInternalsFactory::GetForBrowserState( |
36 ios::ChromeBrowserState* browser_state) { | 36 ios::ChromeBrowserState* browser_state) { |
37 return static_cast<AboutSigninInternals*>( | 37 return static_cast<AboutSigninInternals*>( |
38 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 38 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
39 } | 39 } |
40 | 40 |
41 // static | 41 // static |
42 AboutSigninInternalsFactory* AboutSigninInternalsFactory::GetInstance() { | 42 AboutSigninInternalsFactory* AboutSigninInternalsFactory::GetInstance() { |
43 return Singleton<AboutSigninInternalsFactory>::get(); | 43 return base::Singleton<AboutSigninInternalsFactory>::get(); |
44 } | 44 } |
45 | 45 |
46 scoped_ptr<KeyedService> AboutSigninInternalsFactory::BuildServiceInstanceFor( | 46 scoped_ptr<KeyedService> AboutSigninInternalsFactory::BuildServiceInstanceFor( |
47 web::BrowserState* context) const { | 47 web::BrowserState* context) const { |
48 ios::ChromeBrowserState* chrome_browser_state = | 48 ios::ChromeBrowserState* chrome_browser_state = |
49 ios::ChromeBrowserState::FromBrowserState(context); | 49 ios::ChromeBrowserState::FromBrowserState(context); |
50 scoped_ptr<AboutSigninInternals> service(new AboutSigninInternals( | 50 scoped_ptr<AboutSigninInternals> service(new AboutSigninInternals( |
51 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), | 51 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), |
52 AccountTrackerServiceFactory::GetForBrowserState(chrome_browser_state), | 52 AccountTrackerServiceFactory::GetForBrowserState(chrome_browser_state), |
53 SigninManagerFactory::GetForBrowserState(chrome_browser_state), | 53 SigninManagerFactory::GetForBrowserState(chrome_browser_state), |
54 SigninErrorControllerFactory::GetForBrowserState(chrome_browser_state), | 54 SigninErrorControllerFactory::GetForBrowserState(chrome_browser_state), |
55 GaiaCookieManagerServiceFactory::GetForBrowserState( | 55 GaiaCookieManagerServiceFactory::GetForBrowserState( |
56 chrome_browser_state))); | 56 chrome_browser_state))); |
57 service->Initialize( | 57 service->Initialize( |
58 SigninClientFactory::GetForBrowserState(chrome_browser_state)); | 58 SigninClientFactory::GetForBrowserState(chrome_browser_state)); |
59 return service.Pass(); | 59 return service.Pass(); |
60 } | 60 } |
61 | 61 |
62 void AboutSigninInternalsFactory::RegisterBrowserStatePrefs( | 62 void AboutSigninInternalsFactory::RegisterBrowserStatePrefs( |
63 user_prefs::PrefRegistrySyncable* user_prefs) { | 63 user_prefs::PrefRegistrySyncable* user_prefs) { |
64 AboutSigninInternals::RegisterPrefs(user_prefs); | 64 AboutSigninInternals::RegisterPrefs(user_prefs); |
65 } | 65 } |
66 | 66 |
67 } // namespace ios | 67 } // namespace ios |
OLD | NEW |