Chromium Code Reviews| 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_command_service_factory.h" | |
| 7 #include "chrome/browser/extensions/extension_message_service.h" | 8 #include "chrome/browser/extensions/extension_message_service.h" |
| 8 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" | 11 #include "chrome/browser/extensions/extension_system.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_dependency_manager.h" | 13 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 13 #include "chrome/browser/search_engines/template_url_service_factory.h" | 14 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 14 #include "chrome/browser/themes/theme_service_factory.h" | 15 #include "chrome/browser/themes/theme_service_factory.h" |
| 15 #include "chrome/browser/ui/global_error_service_factory.h" | 16 #include "chrome/browser/ui/global_error_service_factory.h" |
| 16 | 17 |
| 17 // ExtensionSystemSharedFactory | 18 // ExtensionSystemSharedFactory |
| 18 | 19 |
| 19 // static | 20 // static |
| 20 ExtensionSystemImpl::Shared* ExtensionSystemSharedFactory::GetForProfile( | 21 ExtensionSystemImpl::Shared* ExtensionSystemSharedFactory::GetForProfile( |
| 21 Profile* profile) { | 22 Profile* profile) { |
| 22 return static_cast<ExtensionSystemImpl::Shared*>( | 23 return static_cast<ExtensionSystemImpl::Shared*>( |
| 23 GetInstance()->GetServiceForProfile(profile, true)); | 24 GetInstance()->GetServiceForProfile(profile, true)); |
| 24 } | 25 } |
| 25 | 26 |
| 26 // static | 27 // static |
| 27 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { | 28 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { |
| 28 return Singleton<ExtensionSystemSharedFactory>::get(); | 29 return Singleton<ExtensionSystemSharedFactory>::get(); |
| 29 } | 30 } |
| 30 | 31 |
| 31 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() | 32 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() |
| 32 : ProfileKeyedServiceFactory( | 33 : ProfileKeyedServiceFactory( |
| 33 "ExtensionSystemShared", | 34 "ExtensionSystemShared", |
| 34 ProfileDependencyManager::GetInstance()) { | 35 ProfileDependencyManager::GetInstance()) { |
| 36 DependsOn(ExtensionCommandServiceFactory::GetInstance()); | |
|
Aaron Boodman
2012/04/30 17:48:12
This doesn't seem right. You want it the other way
Yoyo Zhou
2012/05/01 01:51:30
Indeed (and you want to depend on ExtensionSystemF
Finnur
2012/05/02 13:50:45
Done.
| |
| 35 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 37 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
| 36 DependsOn(TemplateURLServiceFactory::GetInstance()); | 38 DependsOn(TemplateURLServiceFactory::GetInstance()); |
| 37 DependsOn(ThemeServiceFactory::GetInstance()); | 39 DependsOn(ThemeServiceFactory::GetInstance()); |
| 38 } | 40 } |
| 39 | 41 |
| 40 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { | 42 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { |
| 41 } | 43 } |
| 42 | 44 |
| 43 ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( | 45 ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( |
| 44 Profile* profile) const { | 46 Profile* profile) const { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 return new ExtensionSystemImpl(profile); | 79 return new ExtensionSystemImpl(profile); |
| 78 } | 80 } |
| 79 | 81 |
| 80 bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() { | 82 bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() { |
| 81 return true; | 83 return true; |
| 82 } | 84 } |
| 83 | 85 |
| 84 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() { | 86 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() { |
| 85 return true; | 87 return true; |
| 86 } | 88 } |
| OLD | NEW |