blob: fb9a6ecae4868a2509ff262693bed26506bfe5b3 [file] [log] [blame]
Avi Drissman60039d42022-09-13 21:49:051// Copyright 2014 The Chromium Authors
reillyg0ea3fa902014-10-28 15:30:232// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef EXTENSIONS_BROWSER_PROCESS_MANAGER_FACTORY_H_
6#define EXTENSIONS_BROWSER_PROCESS_MANAGER_FACTORY_H_
7
8#include "base/memory/singleton.h"
9#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
10
11namespace extensions {
12
13class ProcessManager;
14
15class ProcessManagerFactory : public BrowserContextKeyedServiceFactory {
16 public:
Peter Boströmc3d907172021-09-24 18:39:5217 ProcessManagerFactory(const ProcessManagerFactory&) = delete;
18 ProcessManagerFactory& operator=(const ProcessManagerFactory&) = delete;
19
reillyg0ea3fa902014-10-28 15:30:2320 static ProcessManager* GetForBrowserContext(content::BrowserContext* context);
21 // Returns NULL if there is no ProcessManager associated with this context.
22 static ProcessManager* GetForBrowserContextIfExists(
23 content::BrowserContext* context);
24 static ProcessManagerFactory* GetInstance();
25
26 private:
olli.raula36aa8be2015-09-10 11:14:2227 friend struct base::DefaultSingletonTraits<ProcessManagerFactory>;
reillyg0ea3fa902014-10-28 15:30:2328
29 ProcessManagerFactory();
dchengafa76022014-12-28 20:31:5630 ~ProcessManagerFactory() override;
reillyg0ea3fa902014-10-28 15:30:2331
32 // BrowserContextKeyedServiceFactory
dchengafa76022014-12-28 20:31:5633 KeyedService* BuildServiceInstanceFor(
reillyg0ea3fa902014-10-28 15:30:2334 content::BrowserContext* context) const override;
dchengafa76022014-12-28 20:31:5635 content::BrowserContext* GetBrowserContextToUse(
reillyg0ea3fa902014-10-28 15:30:2336 content::BrowserContext* context) const override;
reillyg0ea3fa902014-10-28 15:30:2337};
38
39} // namespace extensions
40
41#endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_FACTORY_H_