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