OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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. | |
4 | |
5 #include "chrome/browser/extensions/extension_system_factory.h" | |
6 | |
7 #include "chrome/browser/extensions/extension_message_service.h" | |
8 #include "chrome/browser/extensions/extension_prefs.h" | |
9 #include "chrome/browser/extensions/extension_service.h" | |
10 #include "chrome/browser/extensions/extension_system.h" | |
11 #include "chrome/browser/profiles/profile.h" | |
12 #include "chrome/browser/profiles/profile_dependency_manager.h" | |
13 #include "chrome/browser/search_engines/template_url_service_factory.h" | |
14 #include "chrome/browser/themes/theme_service_factory.h" | |
15 #include "chrome/browser/ui/global_error_service_factory.h" | |
16 | |
17 // ExtensionSystemSharedFactory | |
18 | |
19 // static | |
20 ExtensionSystemImpl::Shared* ExtensionSystemSharedFactory::GetForProfile( | |
21 Profile* profile) { | |
22 return static_cast<ExtensionSystemImpl::Shared*>( | |
23 GetInstance()->GetServiceForProfile(profile, true)); | |
24 } | |
25 | |
26 // static | |
27 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { | |
28 return Singleton<ExtensionSystemSharedFactory>::get(); | |
29 } | |
30 | |
31 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() | |
32 : ProfileKeyedServiceFactory( | |
33 "ExtensionSystemShared", | |
34 ProfileDependencyManager::GetInstance()) { | |
35 DependsOn(GlobalErrorServiceFactory::GetInstance()); | |
36 DependsOn(TemplateURLServiceFactory::GetInstance()); | |
37 DependsOn(ThemeServiceFactory::GetInstance()); | |
38 } | |
39 | |
40 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { | |
41 } | |
42 | |
43 ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( | |
44 Profile* profile) const { | |
45 return new ExtensionSystemImpl::Shared(profile); | |
46 } | |
47 | |
48 bool ExtensionSystemSharedFactory::ServiceRedirectedInIncognito() { | |
49 return true; | |
50 } | |
51 | |
52 // ExtensionSystemFactory | |
53 | |
54 // static | |
55 ExtensionSystem* ExtensionSystemFactory::GetForProfile( | |
56 Profile* profile) { | |
57 return static_cast<ExtensionSystem*>( | |
58 GetInstance()->GetServiceForProfile(profile, true)); | |
59 } | |
60 | |
61 // static | |
62 ExtensionSystemFactory* ExtensionSystemFactory::GetInstance() { | |
63 return Singleton<ExtensionSystemFactory>::get(); | |
64 } | |
65 | |
66 ExtensionSystemFactory::ExtensionSystemFactory() | |
67 : ProfileKeyedServiceFactory( | |
68 "ExtensionSystem", | |
69 ProfileDependencyManager::GetInstance()) { | |
70 DependsOn(ExtensionSystemSharedFactory::GetInstance()); | |
71 } | |
72 | |
73 ExtensionSystemFactory::~ExtensionSystemFactory() { | |
74 } | |
75 | |
76 ProfileKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( | |
77 Profile* profile) const { | |
78 return new ExtensionSystemImpl(profile); | |
79 } | |
80 | |
81 bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() { | |
82 return true; | |
83 } | |
84 | |
85 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() { | |
86 return true; | |
87 } | |
OLD | NEW |