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_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | |
12 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
13 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | 14 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" |
15 #include "components/ownership/owner_key_util.h" | |
14 | 16 |
15 class KeyedService; | 17 class KeyedService; |
16 class Profile; | 18 class Profile; |
17 | 19 |
18 namespace chromeos { | 20 namespace chromeos { |
19 | 21 |
20 class OwnerSettingsService; | 22 class OwnerSettingsService; |
21 | 23 |
22 class OwnerSettingsServiceFactory : public BrowserContextKeyedServiceFactory { | 24 class OwnerSettingsServiceFactory : public BrowserContextKeyedServiceFactory { |
23 public: | 25 public: |
24 static OwnerSettingsService* GetForProfile(Profile* profile); | 26 static OwnerSettingsService* GetForProfile(Profile* profile); |
25 | 27 |
26 static OwnerSettingsServiceFactory* GetInstance(); | 28 static OwnerSettingsServiceFactory* GetInstance(); |
27 | 29 |
30 scoped_refptr<ownership::OwnerKeyUtil> GetOwnerKeyUtil(); | |
31 | |
32 void set_owner_key_util_for_testing( | |
33 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util) { | |
34 owner_key_util_ = owner_key_util; | |
erikwright (departed)
2014/09/02 19:13:56
I'm not sure if it's appropriate to inline an assi
ygorshenin1
2014/09/03 10:14:58
Done.
| |
35 } | |
36 | |
28 private: | 37 private: |
29 friend struct DefaultSingletonTraits<OwnerSettingsServiceFactory>; | 38 friend struct DefaultSingletonTraits<OwnerSettingsServiceFactory>; |
30 | 39 |
31 OwnerSettingsServiceFactory(); | 40 OwnerSettingsServiceFactory(); |
32 virtual ~OwnerSettingsServiceFactory(); | 41 virtual ~OwnerSettingsServiceFactory(); |
33 | 42 |
34 static KeyedService* BuildInstanceFor(content::BrowserContext* context); | 43 static KeyedService* BuildInstanceFor(content::BrowserContext* context); |
35 | 44 |
36 // BrowserContextKeyedBaseFactory overrides: | 45 // BrowserContextKeyedBaseFactory overrides: |
37 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; | 46 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
38 | 47 |
39 // BrowserContextKeyedServiceFactory implementation: | 48 // BrowserContextKeyedServiceFactory implementation: |
40 virtual KeyedService* BuildServiceInstanceFor( | 49 virtual KeyedService* BuildServiceInstanceFor( |
41 content::BrowserContext* browser_context) const OVERRIDE; | 50 content::BrowserContext* browser_context) const OVERRIDE; |
42 | 51 |
52 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_; | |
53 | |
43 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceFactory); | 54 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceFactory); |
44 }; | 55 }; |
45 | 56 |
46 } // namespace chromeos | 57 } // namespace chromeos |
47 | 58 |
48 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ | 59 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ |
OLD | NEW |