| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BUILDER_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_BUILDER_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/prefs/pref_service_builder.h" | 8 #include "base/prefs/pref_service_factory.h" |
| 9 | 9 |
| 10 class CommandLine; | 10 class CommandLine; |
| 11 class PrefServiceSyncable; | 11 class PrefServiceSyncable; |
| 12 | 12 |
| 13 namespace policy { | 13 namespace policy { |
| 14 class PolicyService; | 14 class PolicyService; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace user_prefs { | 17 namespace user_prefs { |
| 18 class PrefRegistrySyncable; | 18 class PrefRegistrySyncable; |
| 19 } | 19 } |
| 20 | 20 |
| 21 // A PrefServiceBuilder that also knows how to build a | 21 // A PrefServiceFactory that also knows how to build a |
| 22 // PrefServiceSyncable, and may know about Chrome concepts such as | 22 // PrefServiceSyncable, and may know about Chrome concepts such as |
| 23 // PolicyService. | 23 // PolicyService. |
| 24 class PrefServiceSyncableBuilder : public PrefServiceBuilder { | 24 class PrefServiceSyncableFactory : public base::PrefServiceFactory { |
| 25 public: | 25 public: |
| 26 PrefServiceSyncableBuilder(); | 26 PrefServiceSyncableFactory(); |
| 27 virtual ~PrefServiceSyncableBuilder(); | 27 virtual ~PrefServiceSyncableFactory(); |
| 28 | 28 |
| 29 #if defined(ENABLE_CONFIGURATION_POLICY) | 29 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 30 // Set up policy pref stores using the given policy service. | 30 // Set up policy pref stores using the given policy service. |
| 31 PrefServiceSyncableBuilder& WithManagedPolicies( | 31 void SetManagedPolicies(policy::PolicyService* service); |
| 32 policy::PolicyService* service); | 32 void SetRecommendedPolicies(policy::PolicyService* service); |
| 33 PrefServiceSyncableBuilder& WithRecommendedPolicies( | |
| 34 policy::PolicyService* service); | |
| 35 #endif | 33 #endif |
| 36 | 34 |
| 37 // Specifies to use an actual command-line backed command-line pref store. | 35 // Specifies to use an actual command-line backed command-line pref store. |
| 38 PrefServiceSyncableBuilder& WithCommandLine(CommandLine* command_line); | 36 void SetCommandLine(CommandLine* command_line); |
| 39 | 37 |
| 40 virtual PrefServiceSyncable* CreateSyncable( | 38 scoped_ptr<PrefServiceSyncable> CreateSyncable( |
| 41 user_prefs::PrefRegistrySyncable* registry); | 39 user_prefs::PrefRegistrySyncable* registry); |
| 42 | 40 |
| 43 private: | 41 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncableBuilder); | 42 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncableFactory); |
| 45 }; | 43 }; |
| 46 | 44 |
| 47 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_BUILDER_H_ | 45 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_ |
| OLD | NEW |