| 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 class Profile; | 15 class Profile; |
| 16 | 16 |
| 17 namespace ownership { | 17 namespace ownership { |
| 18 class OwnerKeyUtil; | 18 class OwnerKeyUtil; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace chromeos { | 21 namespace chromeos { |
| 22 | 22 |
| 23 class DeviceSettingsService; |
| 23 class OwnerSettingsServiceChromeOS; | 24 class OwnerSettingsServiceChromeOS; |
| 24 | 25 |
| 25 class OwnerSettingsServiceChromeOSFactory | 26 class OwnerSettingsServiceChromeOSFactory |
| 26 : public BrowserContextKeyedServiceFactory { | 27 : public BrowserContextKeyedServiceFactory { |
| 27 public: | 28 public: |
| 28 static OwnerSettingsServiceChromeOS* GetForProfile(Profile* profile); | 29 static OwnerSettingsServiceChromeOS* GetForProfile(Profile* profile); |
| 29 | 30 |
| 30 static OwnerSettingsServiceChromeOSFactory* GetInstance(); | 31 static OwnerSettingsServiceChromeOSFactory* GetInstance(); |
| 31 | 32 |
| 33 static void SetDeviceSettingsServiceForTesting( |
| 34 DeviceSettingsService* device_settings_service); |
| 35 |
| 32 scoped_refptr<ownership::OwnerKeyUtil> GetOwnerKeyUtil(); | 36 scoped_refptr<ownership::OwnerKeyUtil> GetOwnerKeyUtil(); |
| 33 | 37 |
| 34 void SetOwnerKeyUtilForTesting( | 38 void SetOwnerKeyUtilForTesting( |
| 35 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); | 39 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); |
| 36 | 40 |
| 37 private: | 41 private: |
| 38 friend struct DefaultSingletonTraits<OwnerSettingsServiceChromeOSFactory>; | 42 friend struct DefaultSingletonTraits<OwnerSettingsServiceChromeOSFactory>; |
| 39 | 43 |
| 40 OwnerSettingsServiceChromeOSFactory(); | 44 OwnerSettingsServiceChromeOSFactory(); |
| 41 virtual ~OwnerSettingsServiceChromeOSFactory(); | 45 virtual ~OwnerSettingsServiceChromeOSFactory(); |
| 42 | 46 |
| 43 static KeyedService* BuildInstanceFor(content::BrowserContext* context); | 47 static KeyedService* BuildInstanceFor(content::BrowserContext* context); |
| 44 | 48 |
| 45 // BrowserContextKeyedBaseFactory overrides: | 49 // BrowserContextKeyedBaseFactory overrides: |
| 46 virtual bool ServiceIsCreatedWithBrowserContext() const override; | 50 virtual bool ServiceIsCreatedWithBrowserContext() const override; |
| 47 | 51 |
| 48 // BrowserContextKeyedServiceFactory implementation: | 52 // BrowserContextKeyedServiceFactory implementation: |
| 49 virtual KeyedService* BuildServiceInstanceFor( | 53 virtual KeyedService* BuildServiceInstanceFor( |
| 50 content::BrowserContext* browser_context) const override; | 54 content::BrowserContext* browser_context) const override; |
| 51 | 55 |
| 52 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_; | 56 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_; |
| 53 | 57 |
| 54 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSFactory); | 58 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSFactory); |
| 55 }; | 59 }; |
| 56 | 60 |
| 57 } // namespace chromeos | 61 } // namespace chromeos |
| 58 | 62 |
| 59 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FAC
TORY_H_ | 63 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_CHROMEOS_FAC
TORY_H_ |
| OLD | NEW |