1 // Copyright 2014 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 #include "components/pref_registry/testing_pref_service_syncable.h"
8 #include "base/prefs/pref_notifier_impl.h"
9 #include "base/prefs/pref_value_store.h"
10 #include "components/pref_registry/pref_registry_syncable.h"
13 TestingPrefServiceBase
<PrefService
, user_prefs::PrefRegistrySyncable
>::
14 TestingPrefServiceBase(TestingPrefStore
* managed_prefs
,
15 TestingPrefStore
* user_prefs
,
16 TestingPrefStore
* recommended_prefs
,
17 user_prefs::PrefRegistrySyncable
* pref_registry
,
18 PrefNotifierImpl
* pref_notifier
)
19 : PrefService(pref_notifier
,
20 new PrefValueStore(managed_prefs
,
21 NULL
, // supervised_user_prefs
22 NULL
, // extension_prefs
23 NULL
, // command_line_prefs
26 pref_registry
->defaults().get(),
30 base::Bind(&TestingPrefServiceBase
<
32 user_prefs::PrefRegistrySyncable
>::HandleReadError
),
34 managed_prefs_(managed_prefs
),
35 user_prefs_(user_prefs
),
36 recommended_prefs_(recommended_prefs
) {}
38 namespace user_prefs
{
40 TestingPrefServiceSyncable::TestingPrefServiceSyncable()
41 : TestingPrefServiceBase
<PrefService
, PrefRegistrySyncable
>(
42 new TestingPrefStore(),
43 new TestingPrefStore(),
44 new TestingPrefStore(),
45 new PrefRegistrySyncable(),
46 new PrefNotifierImpl()) {
49 TestingPrefServiceSyncable::TestingPrefServiceSyncable(
50 TestingPrefStore
* managed_prefs
,
51 TestingPrefStore
* user_prefs
,
52 TestingPrefStore
* recommended_prefs
,
53 PrefRegistrySyncable
* pref_registry
,
54 PrefNotifierImpl
* pref_notifier
)
55 : TestingPrefServiceBase
<PrefService
, PrefRegistrySyncable
>(
63 TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
66 PrefRegistrySyncable
* TestingPrefServiceSyncable::registry() {
67 return static_cast<PrefRegistrySyncable
*>(DeprecatedGetPrefRegistry());
70 } // namespace user_prefs