blob: 7580867b7413e09ab4997c9b6557523c4fc9a504 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2015 The Chromium Authors
reillyg551eaa42015-11-11 01:29:212// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_
6#define CHROME_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_
7
Mikel Astiz0eb80d652023-05-30 19:44:418#include "base/no_destructor.h"
Ryan Sultanem93f336412022-08-22 17:47:439#include "chrome/browser/profiles/profile_keyed_service_factory.h"
reillyg551eaa42015-11-11 01:29:2110
11class UsbChooserContext;
12class Profile;
13
Ryan Sultanem93f336412022-08-22 17:47:4314class UsbChooserContextFactory : public ProfileKeyedServiceFactory {
reillyg551eaa42015-11-11 01:29:2115 public:
16 static UsbChooserContext* GetForProfile(Profile* profile);
Andy Paicufa96c832021-06-24 16:17:1517 static UsbChooserContext* GetForProfileIfExists(Profile* profile);
reillyg551eaa42015-11-11 01:29:2118 static UsbChooserContextFactory* GetInstance();
19
Peter Boströmfadb1752021-09-30 19:17:0120 UsbChooserContextFactory(const UsbChooserContextFactory&) = delete;
21 UsbChooserContextFactory& operator=(const UsbChooserContextFactory&) = delete;
22
reillyg551eaa42015-11-11 01:29:2123 private:
Mikel Astiz0eb80d652023-05-30 19:44:4124 friend base::NoDestructor<UsbChooserContextFactory>;
reillyg551eaa42015-11-11 01:29:2125
26 UsbChooserContextFactory();
27 ~UsbChooserContextFactory() override;
28
Henrique Nakashima97451242019-04-29 16:14:2829 // BrowserContextKeyedServiceFactory methods:
Arthur Milchior44fcf992024-05-10 17:05:5830 std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext(
reillyg551eaa42015-11-11 01:29:2131 content::BrowserContext* profile) const override;
reillyg551eaa42015-11-11 01:29:2132};
33
34#endif // CHROME_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_