OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/extensions/extension_system_factory.h" | 5 #include "chrome/browser/extensions/extension_system_factory.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_prefs.h" | 7 #include "chrome/browser/extensions/extension_prefs.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/profiles/profile_dependency_manager.h" | 11 #include "chrome/browser/profiles/profile_dependency_manager.h" |
12 #include "chrome/browser/protector/protector_service_factory.h" | |
13 #include "chrome/browser/themes/theme_service_factory.h" | 12 #include "chrome/browser/themes/theme_service_factory.h" |
14 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 13 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
15 | 14 |
16 namespace extensions { | 15 namespace extensions { |
17 | 16 |
18 // ExtensionSystemSharedFactory | 17 // ExtensionSystemSharedFactory |
19 | 18 |
20 // static | 19 // static |
21 ExtensionSystemImpl::Shared* | 20 ExtensionSystemImpl::Shared* |
22 ExtensionSystemSharedFactory::GetForProfile(Profile* profile) { | 21 ExtensionSystemSharedFactory::GetForProfile(Profile* profile) { |
23 return static_cast<ExtensionSystemImpl::Shared*>( | 22 return static_cast<ExtensionSystemImpl::Shared*>( |
24 GetInstance()->GetServiceForProfile(profile, true)); | 23 GetInstance()->GetServiceForProfile(profile, true)); |
25 } | 24 } |
26 | 25 |
27 // static | 26 // static |
28 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { | 27 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { |
29 return Singleton<ExtensionSystemSharedFactory>::get(); | 28 return Singleton<ExtensionSystemSharedFactory>::get(); |
30 } | 29 } |
31 | 30 |
32 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() | 31 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() |
33 : ProfileKeyedServiceFactory( | 32 : ProfileKeyedServiceFactory( |
34 "ExtensionSystemShared", | 33 "ExtensionSystemShared", |
35 ProfileDependencyManager::GetInstance()) { | 34 ProfileDependencyManager::GetInstance()) { |
36 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 35 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
37 #if defined(ENABLE_THEMES) | 36 #if defined(ENABLE_THEMES) |
38 DependsOn(ThemeServiceFactory::GetInstance()); | 37 DependsOn(ThemeServiceFactory::GetInstance()); |
39 #endif | 38 #endif |
40 #if defined(ENABLE_PROTECTOR_SERVICE) | |
41 // ProtectorService should be destroyed after us. | |
42 DependsOn(protector::ProtectorServiceFactory::GetInstance()); | |
43 #endif | |
44 } | 39 } |
45 | 40 |
46 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { | 41 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { |
47 } | 42 } |
48 | 43 |
49 ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( | 44 ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( |
50 Profile* profile) const { | 45 Profile* profile) const { |
51 return new ExtensionSystemImpl::Shared(profile); | 46 return new ExtensionSystemImpl::Shared(profile); |
52 } | 47 } |
53 | 48 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 80 |
86 bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() const { | 81 bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() const { |
87 return true; | 82 return true; |
88 } | 83 } |
89 | 84 |
90 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() const { | 85 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() const { |
91 return true; | 86 return true; |
92 } | 87 } |
93 | 88 |
94 } // namespace extensions | 89 } // namespace extensions |
OLD | NEW |