2022-11-22 21:50:32 +00:00
|
|
|
// Copyright (c) 2022 Microsoft, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_
|
|
|
|
|
|
|
|
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
|
|
|
|
|
2024-02-23 09:35:20 +00:00
|
|
|
namespace base {
|
|
|
|
template <typename T>
|
|
|
|
class NoDestructor;
|
|
|
|
} // namespace base
|
|
|
|
|
2022-11-22 21:50:32 +00:00
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
class UsbChooserContext;
|
|
|
|
|
|
|
|
class UsbChooserContextFactory : public BrowserContextKeyedServiceFactory {
|
|
|
|
public:
|
|
|
|
static UsbChooserContext* GetForBrowserContext(
|
|
|
|
content::BrowserContext* context);
|
|
|
|
static UsbChooserContext* GetForBrowserContextIfExists(
|
|
|
|
content::BrowserContext* context);
|
|
|
|
static UsbChooserContextFactory* GetInstance();
|
|
|
|
|
|
|
|
UsbChooserContextFactory(const UsbChooserContextFactory&) = delete;
|
|
|
|
UsbChooserContextFactory& operator=(const UsbChooserContextFactory&) = delete;
|
|
|
|
|
|
|
|
private:
|
2024-02-23 09:35:20 +00:00
|
|
|
friend base::NoDestructor<UsbChooserContextFactory>;
|
2022-11-22 21:50:32 +00:00
|
|
|
|
|
|
|
UsbChooserContextFactory();
|
|
|
|
~UsbChooserContextFactory() override;
|
|
|
|
|
|
|
|
// BrowserContextKeyedServiceFactory methods:
|
|
|
|
KeyedService* BuildServiceInstanceFor(
|
|
|
|
content::BrowserContext* profile) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
|
|
|
#endif // ELECTRON_SHELL_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_
|