1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // 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_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_FACTORY_H_
6 #define CHROME_BROWSER_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_FACTORY_H_
7 
8 #include "base/macros.h"
9 #include "base/no_destructor.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
11 
12 class BluetoothChooserContext;
13 class Profile;
14 
15 class BluetoothChooserContextFactory
16     : public BrowserContextKeyedServiceFactory {
17  public:
18   static BluetoothChooserContext* GetForProfile(Profile* profile);
19   static BluetoothChooserContextFactory* GetInstance();
20 
21   // Move-only class.
22   BluetoothChooserContextFactory(const BluetoothChooserContextFactory&) =
23       delete;
24   BluetoothChooserContextFactory& operator=(
25       const BluetoothChooserContextFactory&) = delete;
26 
27  private:
28   friend base::NoDestructor<BluetoothChooserContextFactory>;
29 
30   BluetoothChooserContextFactory();
31   ~BluetoothChooserContextFactory() override;
32 
33   // BrowserContextKeyedBaseFactory implementation:
34   KeyedService* BuildServiceInstanceFor(
35       content::BrowserContext* profile) const override;
36   content::BrowserContext* GetBrowserContextToUse(
37       content::BrowserContext* context) const override;
38 };
39 
40 #endif  // CHROME_BROWSER_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_FACTORY_H_
41