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_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ |
6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ |
7 | 7 |
8 #include "base/prefs/pref_service_factory.h" | 8 #include "base/prefs/pref_service_factory.h" |
9 | 9 |
| 10 class PrefModelAssociatorClient; |
10 class PrefServiceSyncable; | 11 class PrefServiceSyncable; |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class CommandLine; | 14 class CommandLine; |
14 } | 15 } |
15 | 16 |
16 namespace policy { | 17 namespace policy { |
| 18 class BrowserPolicyConnector; |
17 class PolicyService; | 19 class PolicyService; |
18 } | 20 } |
19 | 21 |
20 namespace user_prefs { | 22 namespace user_prefs { |
21 class PrefRegistrySyncable; | 23 class PrefRegistrySyncable; |
22 } | 24 } |
23 | 25 |
24 // A PrefServiceFactory that also knows how to build a | 26 // A PrefServiceFactory that also knows how to build a |
25 // PrefServiceSyncable, and may know about Chrome concepts such as | 27 // PrefServiceSyncable, and may know about Chrome concepts such as |
26 // PolicyService. | 28 // PolicyService. |
27 class PrefServiceSyncableFactory : public base::PrefServiceFactory { | 29 class PrefServiceSyncableFactory : public base::PrefServiceFactory { |
28 public: | 30 public: |
29 PrefServiceSyncableFactory(); | 31 PrefServiceSyncableFactory(); |
30 ~PrefServiceSyncableFactory() override; | 32 ~PrefServiceSyncableFactory() override; |
31 | 33 |
32 #if defined(ENABLE_CONFIGURATION_POLICY) | 34 #if defined(ENABLE_CONFIGURATION_POLICY) |
33 // Set up policy pref stores using the given policy service. | 35 // Set up policy pref stores using the given policy service and connector. |
34 void SetManagedPolicies(policy::PolicyService* service); | 36 void SetManagedPolicies(policy::PolicyService* service, |
35 void SetRecommendedPolicies(policy::PolicyService* service); | 37 policy::BrowserPolicyConnector* connector); |
| 38 void SetRecommendedPolicies(policy::PolicyService* service, |
| 39 policy::BrowserPolicyConnector* connector); |
36 #endif | 40 #endif |
37 | 41 |
38 // Specifies to use an actual command-line backed command-line pref store. | 42 // Specifies the PrefModelAssociatorClient to use. |
39 void SetCommandLine(base::CommandLine* command_line); | 43 void SetPrefModelAssociatorClient( |
| 44 PrefModelAssociatorClient* pref_model_associator_client); |
40 | 45 |
41 scoped_ptr<PrefServiceSyncable> CreateSyncable( | 46 scoped_ptr<PrefServiceSyncable> CreateSyncable( |
42 user_prefs::PrefRegistrySyncable* registry); | 47 user_prefs::PrefRegistrySyncable* registry); |
43 | 48 |
44 private: | 49 private: |
| 50 PrefModelAssociatorClient* pref_model_associator_client_; |
| 51 |
45 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncableFactory); | 52 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncableFactory); |
46 }; | 53 }; |
47 | 54 |
48 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ | 55 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ |
OLD | NEW |