1 // Copyright 2013 The Chromium Authors
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_SYNC_PREFERENCES_PREF_SERVICE_SYNCABLE_FACTORY_H_
6 #define COMPONENTS_SYNC_PREFERENCES_PREF_SERVICE_SYNCABLE_FACTORY_H_
10 #include "base/memory/raw_ptr.h"
11 #include "components/prefs/pref_service_factory.h"
12 #include "components/prefs/pref_value_store.h"
15 class BrowserPolicyConnector;
19 namespace user_prefs {
20 class PrefRegistrySyncable;
23 namespace sync_preferences {
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
31 class PrefServiceSyncableFactory : public PrefServiceFactory {
33 PrefServiceSyncableFactory();
35 PrefServiceSyncableFactory(const PrefServiceSyncableFactory&) = delete;
36 PrefServiceSyncableFactory& operator=(const PrefServiceSyncableFactory&) =
39 ~PrefServiceSyncableFactory() override;
41 // Set up policy pref stores using the given policy service and connector.
42 // These will assert when policy is not used.
43 void SetManagedPolicies(policy::PolicyService* service,
44 policy::BrowserPolicyConnector* connector);
45 void SetRecommendedPolicies(policy::PolicyService* service,
46 policy::BrowserPolicyConnector* connector);
48 void SetPrefModelAssociatorClient(
49 PrefModelAssociatorClient* pref_model_associator_client);
51 std::unique_ptr<PrefServiceSyncable> CreateSyncable(
52 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry);
55 raw_ptr<PrefModelAssociatorClient> pref_model_associator_client_ = nullptr;
58 } // namespace sync_preferences
60 #endif // COMPONENTS_SYNC_PREFERENCES_PREF_SERVICE_SYNCABLE_FACTORY_H_