blob: 168d56e15ceebfdd249513f0b45540e1305db375 [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]75fee372013-03-06 00:42:4410#include "components/user_prefs/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,
23 NULL,
24 NULL,
25 user_prefs,
26 recommended_prefs,
27 pref_registry->defaults(),
28 pref_notifier),
29 user_prefs,
30 pref_registry,
31 base::Bind(&TestingPrefServiceBase<
32 PrefServiceSyncable,
33 user_prefs::PrefRegistrySyncable>::HandleReadError),
34 false),
[email protected]7688968a2013-02-12 21:45:1335 managed_prefs_(managed_prefs),
36 user_prefs_(user_prefs),
[email protected]443e9312013-05-06 06:17:3437 recommended_prefs_(recommended_prefs) {}
[email protected]7688968a2013-02-12 21:45:1338
39TestingPrefServiceSyncable::TestingPrefServiceSyncable()
[email protected]443e9312013-05-06 06:17:3440 : TestingPrefServiceBase<PrefServiceSyncable,
41 user_prefs::PrefRegistrySyncable>(
[email protected]7688968a2013-02-12 21:45:1342 new TestingPrefStore(),
43 new TestingPrefStore(),
44 new TestingPrefStore(),
[email protected]443e9312013-05-06 06:17:3445 new user_prefs::PrefRegistrySyncable(),
[email protected]7688968a2013-02-12 21:45:1346 new PrefNotifierImpl()) {
47}
48
[email protected]f830f3d2013-03-12 22:23:4849TestingPrefServiceSyncable::TestingPrefServiceSyncable(
50 TestingPrefStore* managed_prefs,
51 TestingPrefStore* user_prefs,
52 TestingPrefStore* recommended_prefs,
[email protected]443e9312013-05-06 06:17:3453 user_prefs::PrefRegistrySyncable* pref_registry,
[email protected]f830f3d2013-03-12 22:23:4854 PrefNotifierImpl* pref_notifier)
[email protected]443e9312013-05-06 06:17:3455 : TestingPrefServiceBase<PrefServiceSyncable,
56 user_prefs::PrefRegistrySyncable>(
[email protected]f830f3d2013-03-12 22:23:4857 managed_prefs,
58 user_prefs,
59 recommended_prefs,
60 pref_registry,
61 pref_notifier) {
62}
63
[email protected]7688968a2013-02-12 21:45:1364TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
65}
66
[email protected]443e9312013-05-06 06:17:3467user_prefs::PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
68 return static_cast<user_prefs::PrefRegistrySyncable*>(
69 DeprecatedGetPrefRegistry());
[email protected]7688968a2013-02-12 21:45:1370}