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
3 // found in the LICENSE file.
5 #include "extensions/browser/process_map_factory.h"
7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "extensions/browser/extensions_browser_client.h"
9 #include "extensions/browser/process_map.h"
11 using content::BrowserContext
;
13 namespace extensions
{
16 ProcessMap
* ProcessMapFactory::GetForBrowserContext(BrowserContext
* context
) {
17 return static_cast<ProcessMap
*>(
18 GetInstance()->GetServiceForBrowserContext(context
, true));
22 ProcessMapFactory
* ProcessMapFactory::GetInstance() {
23 return Singleton
<ProcessMapFactory
>::get();
26 ProcessMapFactory::ProcessMapFactory()
27 : BrowserContextKeyedServiceFactory(
29 BrowserContextDependencyManager::GetInstance()) {
30 // No dependencies on other services.
33 ProcessMapFactory::~ProcessMapFactory() {}
35 KeyedService
* ProcessMapFactory::BuildServiceInstanceFor(
36 BrowserContext
* context
) const {
37 return new ProcessMap
;
40 BrowserContext
* ProcessMapFactory::GetBrowserContextToUse(
41 BrowserContext
* context
) const {
42 // Redirected in incognito.
43 return ExtensionsBrowserClient::Get()->GetOriginalContext(context
);
46 } // namespace extensions