blob: 79464026701970c9ce9387e2ff8db64337f36853 [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
5#include "chrome/test/base/testing_pref_service_syncable.h"
6
7#include "base/bind.h"
8#include "base/prefs/pref_notifier_impl.h"
9#include "base/prefs/pref_value_store.h"
[email protected]f0c8c4992014-05-15 17:37:2610#include "components/pref_registry/pref_registry_syncable.h"
[email protected]7688968a2013-02-12 21:45:1311#include "testing/gtest/include/gtest/gtest.h"
12
[email protected]443e9312013-05-06 06:17:3413template <>
14TestingPrefServiceBase<PrefServiceSyncable, user_prefs::PrefRegistrySyncable>::
15 TestingPrefServiceBase(TestingPrefStore* managed_prefs,
16 TestingPrefStore* user_prefs,
17 TestingPrefStore* recommended_prefs,
18 user_prefs::PrefRegistrySyncable* pref_registry,
19 PrefNotifierImpl* pref_notifier)
[email protected]7688968a2013-02-12 21:45:1320 : PrefServiceSyncable(
[email protected]443e9312013-05-06 06:17:3421 pref_notifier,
22 new PrefValueStore(managed_prefs,
[email protected]6c2b0672013-08-29 21:49:1823 NULL, // supervised_user_prefs
[email protected]607f2432013-08-29 11:53:4024 NULL, // extension_prefs
25 NULL, // command_line_prefs
[email protected]443e9312013-05-06 06:17:3426 user_prefs,
27 recommended_prefs,
[email protected]cadac622013-06-11 16:46:3628 pref_registry->defaults().get(),
[email protected]443e9312013-05-06 06:17:3429 pref_notifier),
30 user_prefs,
31 pref_registry,
32 base::Bind(&TestingPrefServiceBase<
33 PrefServiceSyncable,
34 user_prefs::PrefRegistrySyncable>::HandleReadError),
35 false),
[email protected]7688968a2013-02-12 21:45:1336 managed_prefs_(managed_prefs),
37 user_prefs_(user_prefs),
[email protected]443e9312013-05-06 06:17:3438 recommended_prefs_(recommended_prefs) {}
[email protected]7688968a2013-02-12 21:45:1339
40TestingPrefServiceSyncable::TestingPrefServiceSyncable()
[email protected]443e9312013-05-06 06:17:3441 : TestingPrefServiceBase<PrefServiceSyncable,
42 user_prefs::PrefRegistrySyncable>(
[email protected]7688968a2013-02-12 21:45:1343 new TestingPrefStore(),
44 new TestingPrefStore(),
45 new TestingPrefStore(),
[email protected]443e9312013-05-06 06:17:3446 new user_prefs::PrefRegistrySyncable(),
[email protected]7688968a2013-02-12 21:45:1347 new PrefNotifierImpl()) {
48}
49
[email protected]f830f3d2013-03-12 22:23:4850TestingPrefServiceSyncable::TestingPrefServiceSyncable(
51 TestingPrefStore* managed_prefs,
52 TestingPrefStore* user_prefs,
53 TestingPrefStore* recommended_prefs,
[email protected]443e9312013-05-06 06:17:3454 user_prefs::PrefRegistrySyncable* pref_registry,
[email protected]f830f3d2013-03-12 22:23:4855 PrefNotifierImpl* pref_notifier)
[email protected]443e9312013-05-06 06:17:3456 : TestingPrefServiceBase<PrefServiceSyncable,
57 user_prefs::PrefRegistrySyncable>(
[email protected]f830f3d2013-03-12 22:23:4858 managed_prefs,
59 user_prefs,
60 recommended_prefs,
61 pref_registry,
62 pref_notifier) {
63}
64
[email protected]7688968a2013-02-12 21:45:1365TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
66}
67
[email protected]443e9312013-05-06 06:17:3468user_prefs::PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
69 return static_cast<user_prefs::PrefRegistrySyncable*>(
70 DeprecatedGetPrefRegistry());
[email protected]7688968a2013-02-12 21:45:1371}