Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / ownership / owner_settings_service_chromeos_factory.h
blob47df71d7872ce6e80ccaedf50f3c49fc614682c6
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"
14 class KeyedService;
16 namespace content {
17 class BrowserContext;
20 namespace ownership {
21 class OwnerKeyUtil;
24 namespace chromeos {
26 class DeviceSettingsService;
27 class OwnerSettingsServiceChromeOS;
29 class OwnerSettingsServiceChromeOSFactory
30 : public BrowserContextKeyedServiceFactory {
31 public:
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);
45 private:
46 friend struct base::DefaultSingletonTraits<
47 OwnerSettingsServiceChromeOSFactory>;
49 OwnerSettingsServiceChromeOSFactory();
50 ~OwnerSettingsServiceChromeOSFactory() override;
52 static KeyedService* BuildInstanceFor(content::BrowserContext* context);
54 // BrowserContextKeyedBaseFactory overrides:
55 bool ServiceIsCreatedWithBrowserContext() const override;
57 // BrowserContextKeyedServiceFactory implementation:
58 KeyedService* BuildServiceInstanceFor(
59 content::BrowserContext* browser_context) const override;
61 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_;
63 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSFactory);
66 } // namespace chromeos
68 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTORY_H_