| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTOR
Y_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTOR
Y_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTOR
Y_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FACTOR
Y_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 12 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 13 | 13 |
| 14 class KeyedService; | 14 class KeyedService; |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class BrowserContext; | 17 class BrowserContext; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ownership { | 20 namespace ownership { |
| 21 class OwnerKeyUtil; | 21 class OwnerKeyUtil; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace chromeos { | 24 namespace chromeos { |
| 25 | 25 |
| 26 class CrosSettings; |
| 26 class DeviceSettingsService; | 27 class DeviceSettingsService; |
| 27 class OwnerSettingsServiceChromeOS; | 28 class OwnerSettingsServiceChromeOS; |
| 28 | 29 |
| 29 class OwnerSettingsServiceChromeOSFactory | 30 class OwnerSettingsServiceChromeOSFactory |
| 30 : public BrowserContextKeyedServiceFactory { | 31 : public BrowserContextKeyedServiceFactory { |
| 31 public: | 32 public: |
| 32 static OwnerSettingsServiceChromeOS* GetForBrowserContext( | 33 static OwnerSettingsServiceChromeOS* GetForBrowserContext( |
| 33 content::BrowserContext* context); | 34 content::BrowserContext* context); |
| 34 | 35 |
| 35 static OwnerSettingsServiceChromeOSFactory* GetInstance(); | 36 static OwnerSettingsServiceChromeOSFactory* GetInstance(); |
| 36 | 37 |
| 37 static void SetDeviceSettingsServiceForTesting( | 38 static void SetDeviceSettingsServiceForTesting( |
| 38 DeviceSettingsService* device_settings_service); | 39 DeviceSettingsService* device_settings_service); |
| 39 | 40 |
| 41 static void SetCrosSettingsForTesting(CrosSettings* cros_settings); |
| 42 |
| 40 scoped_refptr<ownership::OwnerKeyUtil> GetOwnerKeyUtil(); | 43 scoped_refptr<ownership::OwnerKeyUtil> GetOwnerKeyUtil(); |
| 41 | 44 |
| 42 void SetOwnerKeyUtilForTesting( | 45 void SetOwnerKeyUtilForTesting( |
| 43 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); | 46 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); |
| 44 | 47 |
| 45 private: | 48 private: |
| 46 friend struct DefaultSingletonTraits<OwnerSettingsServiceChromeOSFactory>; | 49 friend struct DefaultSingletonTraits<OwnerSettingsServiceChromeOSFactory>; |
| 47 | 50 |
| 48 OwnerSettingsServiceChromeOSFactory(); | 51 OwnerSettingsServiceChromeOSFactory(); |
| 49 ~OwnerSettingsServiceChromeOSFactory() override; | 52 ~OwnerSettingsServiceChromeOSFactory() override; |
| 50 | 53 |
| 51 static KeyedService* BuildInstanceFor(content::BrowserContext* context); | 54 static KeyedService* BuildInstanceFor(content::BrowserContext* context); |
| 52 | 55 |
| 53 // BrowserContextKeyedBaseFactory overrides: | 56 // BrowserContextKeyedBaseFactory overrides: |
| 54 bool ServiceIsCreatedWithBrowserContext() const override; | 57 bool ServiceIsCreatedWithBrowserContext() const override; |
| 55 | 58 |
| 56 // BrowserContextKeyedServiceFactory implementation: | 59 // BrowserContextKeyedServiceFactory implementation: |
| 57 KeyedService* BuildServiceInstanceFor( | 60 KeyedService* BuildServiceInstanceFor( |
| 58 content::BrowserContext* browser_context) const override; | 61 content::BrowserContext* browser_context) const override; |
| 59 | 62 |
| 60 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_; | 63 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_; |
| 61 | 64 |
| 62 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSFactory); | 65 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSFactory); |
| 63 }; | 66 }; |
| 64 | 67 |
| 65 } // namespace chromeos | 68 } // namespace chromeos |
| 66 | 69 |
| 67 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FAC
TORY_H_ | 70 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FAC
TORY_H_ |
| OLD | NEW |