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/account_consistency_service_factory.h" | 5 #include "ios/chrome/browser/signin/account_consistency_service_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/ios/browser/account_consistency_service.h" | 9 #include "components/signin/ios/browser/account_consistency_service.h" |
10 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h" | 10 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 if (!experimental_flags::IsWKWebViewEnabled()) { | 34 if (!experimental_flags::IsWKWebViewEnabled()) { |
35 return nullptr; | 35 return nullptr; |
36 } | 36 } |
37 return static_cast<AccountConsistencyService*>( | 37 return static_cast<AccountConsistencyService*>( |
38 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 38 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
39 } | 39 } |
40 | 40 |
41 // static | 41 // static |
42 AccountConsistencyServiceFactory* | 42 AccountConsistencyServiceFactory* |
43 AccountConsistencyServiceFactory::GetInstance() { | 43 AccountConsistencyServiceFactory::GetInstance() { |
44 return Singleton<AccountConsistencyServiceFactory>::get(); | 44 return base::Singleton<AccountConsistencyServiceFactory>::get(); |
45 } | 45 } |
46 | 46 |
47 void AccountConsistencyServiceFactory::RegisterBrowserStatePrefs( | 47 void AccountConsistencyServiceFactory::RegisterBrowserStatePrefs( |
48 user_prefs::PrefRegistrySyncable* registry) { | 48 user_prefs::PrefRegistrySyncable* registry) { |
49 AccountConsistencyService::RegisterPrefs(registry); | 49 AccountConsistencyService::RegisterPrefs(registry); |
50 } | 50 } |
51 | 51 |
52 scoped_ptr<KeyedService> | 52 scoped_ptr<KeyedService> |
53 AccountConsistencyServiceFactory::BuildServiceInstanceFor( | 53 AccountConsistencyServiceFactory::BuildServiceInstanceFor( |
54 web::BrowserState* context) const { | 54 web::BrowserState* context) const { |
55 ios::ChromeBrowserState* chrome_browser_state = | 55 ios::ChromeBrowserState* chrome_browser_state = |
56 ios::ChromeBrowserState::FromBrowserState(context); | 56 ios::ChromeBrowserState::FromBrowserState(context); |
57 return make_scoped_ptr(new AccountConsistencyService( | 57 return make_scoped_ptr(new AccountConsistencyService( |
58 chrome_browser_state, | 58 chrome_browser_state, |
59 ios::CookieSettingsFactory::GetForBrowserState(chrome_browser_state), | 59 ios::CookieSettingsFactory::GetForBrowserState(chrome_browser_state), |
60 GaiaCookieManagerServiceFactory::GetForBrowserState(chrome_browser_state), | 60 GaiaCookieManagerServiceFactory::GetForBrowserState(chrome_browser_state), |
61 SigninClientFactory::GetForBrowserState(chrome_browser_state), | 61 SigninClientFactory::GetForBrowserState(chrome_browser_state), |
62 ios::SigninManagerFactory::GetForBrowserState(chrome_browser_state))); | 62 ios::SigninManagerFactory::GetForBrowserState(chrome_browser_state))); |
63 } | 63 } |
64 | 64 |
65 bool AccountConsistencyServiceFactory::ServiceIsCreatedWithBrowserState() | 65 bool AccountConsistencyServiceFactory::ServiceIsCreatedWithBrowserState() |
66 const { | 66 const { |
67 return true; | 67 return true; |
68 } | 68 } |
69 | 69 |
70 } // namespace ios | 70 } // namespace ios |
OLD | NEW |