Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / syncable_prefs / pref_service_syncable_factory.h
blob5b28e3c420f8f7d58ebc9afc667e7c04c09ee07b
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_
6 #define COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_
8 #include "base/prefs/pref_service_factory.h"
10 namespace base {
11 class CommandLine;
14 namespace policy {
15 class BrowserPolicyConnector;
16 class PolicyService;
19 namespace user_prefs {
20 class PrefRegistrySyncable;
23 namespace syncable_prefs {
25 class PrefModelAssociatorClient;
26 class PrefServiceSyncable;
28 // A PrefServiceFactory that also knows how to build a
29 // PrefServiceSyncable, and may know about Chrome concepts such as
30 // PolicyService.
31 class PrefServiceSyncableFactory : public base::PrefServiceFactory {
32 public:
33 PrefServiceSyncableFactory();
34 ~PrefServiceSyncableFactory() override;
36 #if defined(ENABLE_CONFIGURATION_POLICY)
37 // Set up policy pref stores using the given policy service and connector.
38 void SetManagedPolicies(policy::PolicyService* service,
39 policy::BrowserPolicyConnector* connector);
40 void SetRecommendedPolicies(policy::PolicyService* service,
41 policy::BrowserPolicyConnector* connector);
42 #endif
44 void SetPrefModelAssociatorClient(
45 PrefModelAssociatorClient* pref_model_associator_client);
47 scoped_ptr<PrefServiceSyncable> CreateSyncable(
48 user_prefs::PrefRegistrySyncable* registry);
50 private:
51 PrefModelAssociatorClient* pref_model_associator_client_;
53 DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncableFactory);
56 } // namespace syncable_prefs
58 #endif // COMPONENTS_SYNCABLE_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_