OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ |
6 #define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ | 6 #define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
10 | 10 |
| 11 namespace base { |
11 template <typename T> | 12 template <typename T> |
12 struct DefaultSingletonTraits; | 13 struct DefaultSingletonTraits; |
| 14 } // namespace base |
13 | 15 |
14 class PrefRegistrySimple; | 16 class PrefRegistrySimple; |
15 | 17 |
16 namespace content { | 18 namespace content { |
17 class BrowserContext; | 19 class BrowserContext; |
18 } | 20 } |
19 | 21 |
20 namespace user_prefs { | 22 namespace user_prefs { |
21 class PrefRegistrySyncable; | 23 class PrefRegistrySyncable; |
22 } | 24 } |
23 | 25 |
24 class AutomaticProfileResetter; | 26 class AutomaticProfileResetter; |
25 | 27 |
26 class AutomaticProfileResetterFactory | 28 class AutomaticProfileResetterFactory |
27 : public BrowserContextKeyedServiceFactory { | 29 : public BrowserContextKeyedServiceFactory { |
28 public: | 30 public: |
29 static AutomaticProfileResetter* GetForBrowserContext( | 31 static AutomaticProfileResetter* GetForBrowserContext( |
30 content::BrowserContext* context); | 32 content::BrowserContext* context); |
31 static AutomaticProfileResetterFactory* GetInstance(); | 33 static AutomaticProfileResetterFactory* GetInstance(); |
32 | 34 |
33 // Registers Local State preferences. | 35 // Registers Local State preferences. |
34 static void RegisterPrefs(PrefRegistrySimple* registry); | 36 static void RegisterPrefs(PrefRegistrySimple* registry); |
35 | 37 |
36 private: | 38 private: |
37 friend struct DefaultSingletonTraits<AutomaticProfileResetterFactory>; | 39 friend struct base::DefaultSingletonTraits<AutomaticProfileResetterFactory>; |
38 | 40 |
39 AutomaticProfileResetterFactory(); | 41 AutomaticProfileResetterFactory(); |
40 ~AutomaticProfileResetterFactory() override; | 42 ~AutomaticProfileResetterFactory() override; |
41 | 43 |
42 // BrowserContextKeyedServiceFactory: | 44 // BrowserContextKeyedServiceFactory: |
43 KeyedService* BuildServiceInstanceFor( | 45 KeyedService* BuildServiceInstanceFor( |
44 content::BrowserContext* context) const override; | 46 content::BrowserContext* context) const override; |
45 | 47 |
46 // BrowserContextKeyedBaseFactory: | 48 // BrowserContextKeyedBaseFactory: |
47 void RegisterProfilePrefs( | 49 void RegisterProfilePrefs( |
48 user_prefs::PrefRegistrySyncable* registry) override; | 50 user_prefs::PrefRegistrySyncable* registry) override; |
49 bool ServiceIsCreatedWithBrowserContext() const override; | 51 bool ServiceIsCreatedWithBrowserContext() const override; |
50 bool ServiceIsNULLWhileTesting() const override; | 52 bool ServiceIsNULLWhileTesting() const override; |
51 | 53 |
52 DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetterFactory); | 54 DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetterFactory); |
53 }; | 55 }; |
54 | 56 |
55 #endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ | 57 #endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_FACTORY_H_ |
OLD | NEW |