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.
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
#ifndef SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
|
|
|
|
#define SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
|
2019-07-24 23:01:08 +00:00
|
|
|
|
|
|
|
#include "base/macros.h"
|
|
|
|
#include "base/memory/singleton.h"
|
|
|
|
#include "extensions/browser/extension_system_provider.h"
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
private:
|
2020-02-03 22:01:10 +00:00
|
|
|
friend struct base::DefaultSingletonTraits<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;
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionSystemFactory);
|
2019-07-24 23:01:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace extensions
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
#endif // SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
|