OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/managed_mode/managed_user_service_factory.h" | 5 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_system_factory.h" | 7 #include "chrome/browser/extensions/extension_system_factory.h" |
8 #include "chrome/browser/managed_mode/managed_user_service.h" | 8 #include "chrome/browser/managed_mode/managed_user_service.h" |
9 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | |
11 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" | 12 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" |
12 | 13 |
13 // static | 14 // static |
14 ManagedUserService* ManagedUserServiceFactory::GetForProfile(Profile* profile) { | 15 ManagedUserService* ManagedUserServiceFactory::GetForProfile(Profile* profile) { |
15 return static_cast<ManagedUserService*>( | 16 return static_cast<ManagedUserService*>( |
16 GetInstance()->GetServiceForBrowserContext(profile, true)); | 17 GetInstance()->GetServiceForBrowserContext(profile, true)); |
17 } | 18 } |
18 | 19 |
19 // static | 20 // static |
20 ManagedUserServiceFactory* ManagedUserServiceFactory::GetInstance() { | 21 ManagedUserServiceFactory* ManagedUserServiceFactory::GetInstance() { |
21 return Singleton<ManagedUserServiceFactory>::get(); | 22 return Singleton<ManagedUserServiceFactory>::get(); |
22 } | 23 } |
23 | 24 |
24 // static | 25 // static |
25 BrowserContextKeyedService* ManagedUserServiceFactory::BuildInstanceFor( | 26 BrowserContextKeyedService* ManagedUserServiceFactory::BuildInstanceFor( |
26 Profile* profile) { | 27 Profile* profile) { |
27 return new ManagedUserService(profile); | 28 return new ManagedUserService(profile); |
28 } | 29 } |
29 | 30 |
30 ManagedUserServiceFactory::ManagedUserServiceFactory() | 31 ManagedUserServiceFactory::ManagedUserServiceFactory() |
31 : BrowserContextKeyedServiceFactory( | 32 : BrowserContextKeyedServiceFactory( |
32 "ManagedUserService", | 33 "ManagedUserService", |
33 BrowserContextDependencyManager::GetInstance()) { | 34 BrowserContextDependencyManager::GetInstance()) { |
34 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); | 35 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
36 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); | |
Bernhard Bauer
2013/11/14 16:42:14
Note that ManagedUserService does not depend on PO
Roger Tawa OOO till Jul 10th
2013/11/14 18:19:42
Got it. I think the error was likely due to PO2TS
| |
35 } | 37 } |
36 | 38 |
37 ManagedUserServiceFactory::~ManagedUserServiceFactory() {} | 39 ManagedUserServiceFactory::~ManagedUserServiceFactory() {} |
38 | 40 |
39 content::BrowserContext* ManagedUserServiceFactory::GetBrowserContextToUse( | 41 content::BrowserContext* ManagedUserServiceFactory::GetBrowserContextToUse( |
40 content::BrowserContext* context) const { | 42 content::BrowserContext* context) const { |
41 return chrome::GetBrowserContextRedirectedInIncognito(context); | 43 return chrome::GetBrowserContextRedirectedInIncognito(context); |
42 } | 44 } |
43 | 45 |
44 BrowserContextKeyedService* ManagedUserServiceFactory::BuildServiceInstanceFor( | 46 BrowserContextKeyedService* ManagedUserServiceFactory::BuildServiceInstanceFor( |
45 content::BrowserContext* profile) const { | 47 content::BrowserContext* profile) const { |
46 return BuildInstanceFor(static_cast<Profile*>(profile)); | 48 return BuildInstanceFor(static_cast<Profile*>(profile)); |
47 } | 49 } |
OLD | NEW |