1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTORY_H_
6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTORY_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/singleton.h"
12 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
26 class DeviceSettingsService
;
27 class OwnerSettingsServiceChromeOS
;
29 class OwnerSettingsServiceChromeOSFactory
30 : public BrowserContextKeyedServiceFactory
{
32 static OwnerSettingsServiceChromeOS
* GetForBrowserContext(
33 content::BrowserContext
* context
);
35 static OwnerSettingsServiceChromeOSFactory
* GetInstance();
37 static void SetDeviceSettingsServiceForTesting(
38 DeviceSettingsService
* device_settings_service
);
40 scoped_refptr
<ownership::OwnerKeyUtil
> GetOwnerKeyUtil();
42 void SetOwnerKeyUtilForTesting(
43 const scoped_refptr
<ownership::OwnerKeyUtil
>& owner_key_util
);
46 friend struct DefaultSingletonTraits
<OwnerSettingsServiceChromeOSFactory
>;
48 OwnerSettingsServiceChromeOSFactory();
49 ~OwnerSettingsServiceChromeOSFactory() override
;
51 static KeyedService
* BuildInstanceFor(content::BrowserContext
* context
);
53 // BrowserContextKeyedBaseFactory overrides:
54 bool ServiceIsCreatedWithBrowserContext() const override
;
56 // BrowserContextKeyedServiceFactory implementation:
57 KeyedService
* BuildServiceInstanceFor(
58 content::BrowserContext
* browser_context
) const override
;
60 scoped_refptr
<ownership::OwnerKeyUtil
> owner_key_util_
;
62 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSFactory
);
65 } // namespace chromeos
67 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTORY_H_