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

Side by Side Diff: apps/app_load_service_factory.cc

Issue 137753016: ExtensionSystem cleanup part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jamescook Created 6 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
« no previous file with comments | « apps/DEPS ('k') | apps/apps.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "apps/app_load_service_factory.h" 5 #include "apps/app_load_service_factory.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/shell_window_registry.h" 8 #include "apps/shell_window_registry.h"
9 #include "chrome/browser/extensions/extension_system_factory.h"
10 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
11 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 10 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
12 #include "extensions/browser/extension_prefs_factory.h" 11 #include "extensions/browser/extension_prefs_factory.h"
12 #include "extensions/browser/extension_system_provider.h"
13 #include "extensions/browser/extensions_browser_client.h" 13 #include "extensions/browser/extensions_browser_client.h"
14 14
15 namespace apps { 15 namespace apps {
16 16
17 // static 17 // static
18 AppLoadService* AppLoadServiceFactory::GetForProfile(Profile* profile) { 18 AppLoadService* AppLoadServiceFactory::GetForProfile(Profile* profile) {
19 return static_cast<AppLoadService*>( 19 return static_cast<AppLoadService*>(
20 GetInstance()->GetServiceForBrowserContext(profile, true)); 20 GetInstance()->GetServiceForBrowserContext(profile, true));
21 } 21 }
22 22
23 AppLoadServiceFactory* AppLoadServiceFactory::GetInstance() { 23 AppLoadServiceFactory* AppLoadServiceFactory::GetInstance() {
24 return Singleton<AppLoadServiceFactory>::get(); 24 return Singleton<AppLoadServiceFactory>::get();
25 } 25 }
26 26
27 AppLoadServiceFactory::AppLoadServiceFactory() 27 AppLoadServiceFactory::AppLoadServiceFactory()
28 : BrowserContextKeyedServiceFactory( 28 : BrowserContextKeyedServiceFactory(
29 "AppLoadService", 29 "AppLoadService",
30 BrowserContextDependencyManager::GetInstance()) { 30 BrowserContextDependencyManager::GetInstance()) {
31 DependsOn(
32 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
Yoyo Zhou 2014/02/12 23:32:10 Note: I realized that I'll need to make this chang
31 DependsOn(extensions::ExtensionPrefsFactory::GetInstance()); 33 DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
32 DependsOn(extensions::ExtensionSystemFactory::GetInstance());
33 DependsOn(ShellWindowRegistry::Factory::GetInstance()); 34 DependsOn(ShellWindowRegistry::Factory::GetInstance());
34 } 35 }
35 36
36 AppLoadServiceFactory::~AppLoadServiceFactory() { 37 AppLoadServiceFactory::~AppLoadServiceFactory() {
37 } 38 }
38 39
39 BrowserContextKeyedService* AppLoadServiceFactory::BuildServiceInstanceFor( 40 BrowserContextKeyedService* AppLoadServiceFactory::BuildServiceInstanceFor(
40 content::BrowserContext* profile) const { 41 content::BrowserContext* profile) const {
41 return new AppLoadService(static_cast<Profile*>(profile)); 42 return new AppLoadService(static_cast<Profile*>(profile));
42 } 43 }
43 44
44 bool AppLoadServiceFactory::ServiceIsNULLWhileTesting() const { 45 bool AppLoadServiceFactory::ServiceIsNULLWhileTesting() const {
45 return false; 46 return false;
46 } 47 }
47 48
48 bool AppLoadServiceFactory::ServiceIsCreatedWithBrowserContext() const { 49 bool AppLoadServiceFactory::ServiceIsCreatedWithBrowserContext() const {
49 return true; 50 return true;
50 } 51 }
51 52
52 content::BrowserContext* AppLoadServiceFactory::GetBrowserContextToUse( 53 content::BrowserContext* AppLoadServiceFactory::GetBrowserContextToUse(
53 content::BrowserContext* context) const { 54 content::BrowserContext* context) const {
54 // Redirected in incognito. 55 // Redirected in incognito.
55 return extensions::ExtensionsBrowserClient::Get()-> 56 return extensions::ExtensionsBrowserClient::Get()->
56 GetOriginalContext(context); 57 GetOriginalContext(context);
57 } 58 }
58 59
59 } // namespace apps 60 } // namespace apps
OLDNEW
« no previous file with comments | « apps/DEPS ('k') | apps/apps.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698