blob: 5b3c7ee037db7e5621beeb97cd56a94f643ce003 [file] [log] [blame]
[email protected]7688968a2013-02-12 21:45:131// Copyright (c) 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.
4
maxbogueea16ff412016-10-28 16:35:295#include "components/sync_preferences/testing_pref_service_syncable.h"
[email protected]7688968a2013-02-12 21:45:136
Tim Schumann978e7502018-05-07 13:46:527#include <memory>
8
[email protected]7688968a2013-02-12 21:45:139#include "base/bind.h"
[email protected]f0c8c4992014-05-15 17:37:2610#include "components/pref_registry/pref_registry_syncable.h"
brettwf00b9b42016-02-01 22:11:3811#include "components/prefs/pref_notifier_impl.h"
12#include "components/prefs/pref_value_store.h"
[email protected]7688968a2013-02-12 21:45:1313#include "testing/gtest/include/gtest/gtest.h"
14
[email protected]443e9312013-05-06 06:17:3415template <>
maxbogueea16ff412016-10-28 16:35:2916TestingPrefServiceBase<sync_preferences::PrefServiceSyncable,
sdefresne50c1e522015-09-18 09:47:5117 user_prefs::PrefRegistrySyncable>::
[email protected]443e9312013-05-06 06:17:3418 TestingPrefServiceBase(TestingPrefStore* managed_prefs,
a-v-y658f626b2017-01-09 09:18:4619 TestingPrefStore* extension_prefs,
[email protected]443e9312013-05-06 06:17:3420 TestingPrefStore* user_prefs,
21 TestingPrefStore* recommended_prefs,
22 user_prefs::PrefRegistrySyncable* pref_registry,
23 PrefNotifierImpl* pref_notifier)
maxbogueea16ff412016-10-28 16:35:2924 : sync_preferences::PrefServiceSyncable(
François Degrosee2f030d2017-12-04 00:29:0125 std::unique_ptr<PrefNotifierImpl>(pref_notifier),
26 std::make_unique<PrefValueStore>(managed_prefs,
27 nullptr, // supervised_user_prefs
28 extension_prefs, // extension_prefs
29 nullptr, // command_line_prefs
30 user_prefs,
31 recommended_prefs,
32 pref_registry->defaults().get(),
33 pref_notifier),
[email protected]443e9312013-05-06 06:17:3434 user_prefs,
35 pref_registry,
Tim Schumann978e7502018-05-07 13:46:5236 /*pref_model_associator_client=*/nullptr,
Ken Rockot36778cfc2019-12-18 16:57:0537 base::BindRepeating(
38 &TestingPrefServiceBase<
39 PrefServiceSyncable,
40 user_prefs::PrefRegistrySyncable>::HandleReadError),
[email protected]443e9312013-05-06 06:17:3441 false),
[email protected]7688968a2013-02-12 21:45:1342 managed_prefs_(managed_prefs),
a-v-y658f626b2017-01-09 09:18:4643 extension_prefs_(extension_prefs),
[email protected]7688968a2013-02-12 21:45:1344 user_prefs_(user_prefs),
[email protected]443e9312013-05-06 06:17:3445 recommended_prefs_(recommended_prefs) {}
[email protected]7688968a2013-02-12 21:45:1346
maxbogueea16ff412016-10-28 16:35:2947namespace sync_preferences {
sdefresne50c1e522015-09-18 09:47:5148
[email protected]7688968a2013-02-12 21:45:1349TestingPrefServiceSyncable::TestingPrefServiceSyncable()
[email protected]443e9312013-05-06 06:17:3450 : TestingPrefServiceBase<PrefServiceSyncable,
51 user_prefs::PrefRegistrySyncable>(
maxbogueea16ff412016-10-28 16:35:2952 new TestingPrefStore(),
53 new TestingPrefStore(),
54 new TestingPrefStore(),
a-v-y658f626b2017-01-09 09:18:4655 new TestingPrefStore(),
maxbogueea16ff412016-10-28 16:35:2956 new user_prefs::PrefRegistrySyncable(),
57 new PrefNotifierImpl()) {}
[email protected]7688968a2013-02-12 21:45:1358
[email protected]f830f3d2013-03-12 22:23:4859TestingPrefServiceSyncable::TestingPrefServiceSyncable(
60 TestingPrefStore* managed_prefs,
a-v-y658f626b2017-01-09 09:18:4661 TestingPrefStore* extension_prefs,
[email protected]f830f3d2013-03-12 22:23:4862 TestingPrefStore* user_prefs,
63 TestingPrefStore* recommended_prefs,
[email protected]443e9312013-05-06 06:17:3464 user_prefs::PrefRegistrySyncable* pref_registry,
[email protected]f830f3d2013-03-12 22:23:4865 PrefNotifierImpl* pref_notifier)
[email protected]443e9312013-05-06 06:17:3466 : TestingPrefServiceBase<PrefServiceSyncable,
67 user_prefs::PrefRegistrySyncable>(
maxbogueea16ff412016-10-28 16:35:2968 managed_prefs,
a-v-y658f626b2017-01-09 09:18:4669 extension_prefs,
maxbogueea16ff412016-10-28 16:35:2970 user_prefs,
71 recommended_prefs,
72 pref_registry,
73 pref_notifier) {}
[email protected]f830f3d2013-03-12 22:23:4874
maxbogueea16ff412016-10-28 16:35:2975TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {}
[email protected]7688968a2013-02-12 21:45:1376
[email protected]443e9312013-05-06 06:17:3477user_prefs::PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
78 return static_cast<user_prefs::PrefRegistrySyncable*>(
79 DeprecatedGetPrefRegistry());
[email protected]7688968a2013-02-12 21:45:1380}
sdefresne50c1e522015-09-18 09:47:5181
maxbogueea16ff412016-10-28 16:35:2982} // namespace sync_preferences