2019-07-24 23:01:08 +00:00
|
|
|
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
#include "extensions/browser/extension_system_provider.h"
|
|
|
|
|
2024-02-23 09:35:20 +00:00
|
|
|
namespace base {
|
|
|
|
template <typename T>
|
|
|
|
class NoDestructor;
|
|
|
|
} // namespace base
|
|
|
|
|
2019-07-24 23:01:08 +00:00
|
|
|
namespace extensions {
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
// A factory that provides ElectronExtensionSystem.
|
|
|
|
class ElectronExtensionSystemFactory : public ExtensionSystemProvider {
|
2019-07-24 23:01:08 +00:00
|
|
|
public:
|
|
|
|
// ExtensionSystemProvider implementation:
|
|
|
|
ExtensionSystem* GetForBrowserContext(
|
|
|
|
content::BrowserContext* context) override;
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
static ElectronExtensionSystemFactory* GetInstance();
|
2019-07-24 23:01:08 +00:00
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
ElectronExtensionSystemFactory(const ElectronExtensionSystemFactory&) =
|
|
|
|
delete;
|
|
|
|
ElectronExtensionSystemFactory& operator=(
|
|
|
|
const ElectronExtensionSystemFactory&) = delete;
|
|
|
|
|
2019-07-24 23:01:08 +00:00
|
|
|
private:
|
2024-02-23 09:35:20 +00:00
|
|
|
friend base::NoDestructor<ElectronExtensionSystemFactory>;
|
2019-07-24 23:01:08 +00:00
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
ElectronExtensionSystemFactory();
|
|
|
|
~ElectronExtensionSystemFactory() override;
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
// BrowserContextKeyedServiceFactory implementation:
|
|
|
|
KeyedService* BuildServiceInstanceFor(
|
|
|
|
content::BrowserContext* context) const override;
|
|
|
|
content::BrowserContext* GetBrowserContextToUse(
|
|
|
|
content::BrowserContext* context) const override;
|
|
|
|
bool ServiceIsCreatedWithBrowserContext() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace extensions
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
|