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

Side by Side Diff: chrome/browser/apps/ephemeral_app_service_factory.cc

Issue 148083014: ExtensionSystem cleanup part 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac 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 | « no previous file | chrome/browser/autocomplete/autocomplete_classifier_factory.cc » ('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 "chrome/browser/apps/ephemeral_app_service_factory.h" 5 #include "chrome/browser/apps/ephemeral_app_service_factory.h"
6 6
7 #include "chrome/browser/apps/ephemeral_app_service.h" 7 #include "chrome/browser/apps/ephemeral_app_service.h"
8 #include "chrome/browser/extensions/extension_system_factory.h"
9 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
10 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 9 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
10 #include "extensions/browser/extension_system_provider.h"
11 #include "extensions/browser/extensions_browser_client.h" 11 #include "extensions/browser/extensions_browser_client.h"
12 12
13 using extensions::ExtensionSystemFactory; 13 using extensions::ExtensionsBrowserClient;
14 14
15 // static 15 // static
16 EphemeralAppService* 16 EphemeralAppService*
17 EphemeralAppServiceFactory::GetForProfile(Profile* profile) { 17 EphemeralAppServiceFactory::GetForProfile(Profile* profile) {
18 return static_cast<EphemeralAppService*>( 18 return static_cast<EphemeralAppService*>(
19 GetInstance()->GetServiceForBrowserContext(profile, true)); 19 GetInstance()->GetServiceForBrowserContext(profile, true));
20 } 20 }
21 21
22 // static 22 // static
23 EphemeralAppServiceFactory* EphemeralAppServiceFactory::GetInstance() { 23 EphemeralAppServiceFactory* EphemeralAppServiceFactory::GetInstance() {
24 return Singleton<EphemeralAppServiceFactory>::get(); 24 return Singleton<EphemeralAppServiceFactory>::get();
25 } 25 }
26 26
27 EphemeralAppServiceFactory::EphemeralAppServiceFactory() 27 EphemeralAppServiceFactory::EphemeralAppServiceFactory()
28 : BrowserContextKeyedServiceFactory( 28 : BrowserContextKeyedServiceFactory(
29 "EphemeralAppService", 29 "EphemeralAppService",
30 BrowserContextDependencyManager::GetInstance()) { 30 BrowserContextDependencyManager::GetInstance()) {
31 DependsOn(ExtensionSystemFactory::GetInstance()); 31 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
32 } 32 }
33 33
34 EphemeralAppServiceFactory::~EphemeralAppServiceFactory() { 34 EphemeralAppServiceFactory::~EphemeralAppServiceFactory() {
35 } 35 }
36 36
37 BrowserContextKeyedService* EphemeralAppServiceFactory::BuildServiceInstanceFor( 37 BrowserContextKeyedService* EphemeralAppServiceFactory::BuildServiceInstanceFor(
38 content::BrowserContext* context) const { 38 content::BrowserContext* context) const {
39 return new EphemeralAppService(Profile::FromBrowserContext(context)); 39 return new EphemeralAppService(Profile::FromBrowserContext(context));
40 } 40 }
41 41
42 content::BrowserContext* EphemeralAppServiceFactory::GetBrowserContextToUse( 42 content::BrowserContext* EphemeralAppServiceFactory::GetBrowserContextToUse(
43 content::BrowserContext* context) const { 43 content::BrowserContext* context) const {
44 return extensions::ExtensionsBrowserClient::Get()-> 44 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
45 GetOriginalContext(context);
46 } 45 }
47 46
48 bool EphemeralAppServiceFactory::ServiceIsCreatedWithBrowserContext() const { 47 bool EphemeralAppServiceFactory::ServiceIsCreatedWithBrowserContext() const {
49 return true; 48 return true;
50 } 49 }
51 50
52 bool EphemeralAppServiceFactory::ServiceIsNULLWhileTesting() const { 51 bool EphemeralAppServiceFactory::ServiceIsNULLWhileTesting() const {
53 return true; 52 return true;
54 } 53 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_classifier_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698