Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1086)

Side by Side Diff: chrome/browser/extensions/extension_system_factory.cc

Issue 9369013: Take extensions out of Profile into a profile-keyed service, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no crashy Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
Aaron Boodman 2012/02/28 00:21:21 Unneeded linebreak.
Yoyo Zhou 2012/02/28 22:58:26 Axed.
14 #include "chrome/browser/search_engines/template_url_service_factory.h"
15 #include "chrome/browser/themes/theme_service_factory.h"
16 #include "chrome/browser/ui/global_error_service_factory.h"
17
18 // ExtensionSystemDelegateFactory
19
20 // static
21 ExtensionSystemImpl::Delegate* ExtensionSystemDelegateFactory::GetForProfile(
22 Profile* profile) {
23 return static_cast<ExtensionSystemImpl::Delegate*>(
24 GetInstance()->GetServiceForProfile(profile, true));
25 }
26
27 // static
28 ExtensionSystemDelegateFactory* ExtensionSystemDelegateFactory::GetInstance() {
29 return Singleton<ExtensionSystemDelegateFactory>::get();
30 }
31
32 ExtensionSystemDelegateFactory::ExtensionSystemDelegateFactory()
33 : ProfileKeyedServiceFactory(
34 "ExtensionSystemDelegate",
35 ProfileDependencyManager::GetInstance()) {
36 DependsOn(GlobalErrorServiceFactory::GetInstance());
37 DependsOn(TemplateURLServiceFactory::GetInstance());
38 DependsOn(ThemeServiceFactory::GetInstance());
39 }
40
41 ExtensionSystemDelegateFactory::~ExtensionSystemDelegateFactory() {
42 }
43
44 ProfileKeyedService* ExtensionSystemDelegateFactory::BuildServiceInstanceFor(
45 Profile* profile) const {
46 return new ExtensionSystemImpl::Delegate(profile);
47 }
48
49 bool ExtensionSystemDelegateFactory::ServiceRedirectedInIncognito() {
50 return true;
51 }
52
53 // ExtensionSystemFactory
54
55 // static
56 ExtensionSystem* ExtensionSystemFactory::GetForProfile(
57 Profile* profile) {
58 return static_cast<ExtensionSystem*>(
59 GetInstance()->GetServiceForProfile(profile, true));
60 }
61
62 // static
63 ExtensionSystemFactory* ExtensionSystemFactory::GetInstance() {
64 return Singleton<ExtensionSystemFactory>::get();
65 }
66
67 ExtensionSystemFactory::ExtensionSystemFactory()
68 : ProfileKeyedServiceFactory(
69 "ExtensionSystem",
70 ProfileDependencyManager::GetInstance()) {
71 DependsOn(ExtensionSystemDelegateFactory::GetInstance());
72 }
73
74 ExtensionSystemFactory::~ExtensionSystemFactory() {
75 }
76
77 ProfileKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor(
78 Profile* profile) const {
79 return new ExtensionSystemImpl(profile);
80 }
81
82 bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() {
83 return true;
84 }
85
86 bool ExtensionSystemFactory::ServiceIsCreatedWithProfile() {
87 return true;
88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698