1 // Copyright 2020 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_UI_WEBUI_SETTINGS_CHROMEOS_OS_SETTINGS_MANAGER_FACTORY_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_OS_SETTINGS_MANAGER_FACTORY_H_
7 
8 #include "base/memory/singleton.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
10 
11 class Profile;
12 
13 namespace chromeos {
14 namespace settings {
15 
16 class OsSettingsManager;
17 
18 class OsSettingsManagerFactory : public BrowserContextKeyedServiceFactory {
19  public:
20   static OsSettingsManager* GetForProfile(Profile* profile);
21   static OsSettingsManagerFactory* GetInstance();
22 
23  private:
24   friend struct base::DefaultSingletonTraits<OsSettingsManagerFactory>;
25 
26   OsSettingsManagerFactory();
27   ~OsSettingsManagerFactory() override;
28 
29   OsSettingsManagerFactory(const OsSettingsManagerFactory&) = delete;
30   OsSettingsManagerFactory& operator=(const OsSettingsManagerFactory&) = delete;
31 
32   // BrowserContextKeyedServiceFactory:
33   KeyedService* BuildServiceInstanceFor(
34       content::BrowserContext* context) const override;
35   bool ServiceIsNULLWhileTesting() const override;
36   content::BrowserContext* GetBrowserContextToUse(
37       content::BrowserContext* context) const override;
38 };
39 
40 }  // namespace settings
41 }  // namespace chromeos
42 
43 #endif  // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_OS_SETTINGS_MANAGER_FACTORY_H_
44