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

Side by Side Diff: extensions/browser/warning_service_factory.cc

Issue 698623002: Split WarningService from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: virtual -> override Created 6 years, 1 month 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
« no previous file with comments | « extensions/browser/warning_service_factory.h ('k') | extensions/extensions.gyp » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/process_map_factory.h" 5 #include "extensions/browser/warning_service_factory.h"
6 6
7 #include "components/keyed_service/content/browser_context_dependency_manager.h" 7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "extensions/browser/extension_registry_factory.h"
8 #include "extensions/browser/extensions_browser_client.h" 9 #include "extensions/browser/extensions_browser_client.h"
9 #include "extensions/browser/process_map.h" 10 #include "extensions/browser/warning_service.h"
10 11
11 using content::BrowserContext; 12 using content::BrowserContext;
12 13
13 namespace extensions { 14 namespace extensions {
14 15
15 // static 16 // static
16 ProcessMap* ProcessMapFactory::GetForBrowserContext(BrowserContext* context) { 17 WarningService* WarningServiceFactory::GetForBrowserContext(
17 return static_cast<ProcessMap*>( 18 BrowserContext* context) {
19 return static_cast<WarningService*>(
18 GetInstance()->GetServiceForBrowserContext(context, true)); 20 GetInstance()->GetServiceForBrowserContext(context, true));
19 } 21 }
20 22
21 // static 23 // static
22 ProcessMapFactory* ProcessMapFactory::GetInstance() { 24 WarningServiceFactory* WarningServiceFactory::GetInstance() {
23 return Singleton<ProcessMapFactory>::get(); 25 return Singleton<WarningServiceFactory>::get();
24 } 26 }
25 27
26 ProcessMapFactory::ProcessMapFactory() 28 WarningServiceFactory::WarningServiceFactory()
27 : BrowserContextKeyedServiceFactory( 29 : BrowserContextKeyedServiceFactory(
28 "ProcessMap", 30 "WarningService",
29 BrowserContextDependencyManager::GetInstance()) { 31 BrowserContextDependencyManager::GetInstance()) {
30 // No dependencies on other services. 32 DependsOn(ExtensionRegistryFactory::GetInstance());
31 } 33 }
32 34
33 ProcessMapFactory::~ProcessMapFactory() {} 35 WarningServiceFactory::~WarningServiceFactory() {
34
35 KeyedService* ProcessMapFactory::BuildServiceInstanceFor(
36 BrowserContext* context) const {
37 return new ProcessMap;
38 } 36 }
39 37
40 BrowserContext* ProcessMapFactory::GetBrowserContextToUse( 38 KeyedService* WarningServiceFactory::BuildServiceInstanceFor(
39 BrowserContext* context) const {
40 return new WarningService(context);
41 }
42
43 BrowserContext* WarningServiceFactory::GetBrowserContextToUse(
41 BrowserContext* context) const { 44 BrowserContext* context) const {
42 // Redirected in incognito. 45 // Redirected in incognito.
43 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); 46 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
44 } 47 }
45 48
46 } // namespace extensions 49 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/warning_service_factory.h ('k') | extensions/extensions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698