Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: chrome/test/base/testing_pref_service_syncable.cc

Issue 1305213009: Componentize PrefSyncableService and support classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable
Patch Set: Add missing dependency on //sync:test_support_sync_api for unit tests with gn Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/base/testing_pref_service_syncable.h ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // 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"
10 #include "components/pref_registry/pref_registry_syncable.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 template <>
14 TestingPrefServiceBase<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)
20 : PrefServiceSyncable(
21 pref_notifier,
22 new PrefValueStore(managed_prefs,
23 nullptr, // supervised_user_prefs
24 nullptr, // extension_prefs
25 nullptr, // command_line_prefs
26 user_prefs,
27 recommended_prefs,
28 pref_registry->defaults().get(),
29 pref_notifier),
30 user_prefs,
31 pref_registry,
32 nullptr, // pref_model_associator_client
33 base::Bind(&TestingPrefServiceBase<
34 PrefServiceSyncable,
35 user_prefs::PrefRegistrySyncable>::HandleReadError),
36 false),
37 managed_prefs_(managed_prefs),
38 user_prefs_(user_prefs),
39 recommended_prefs_(recommended_prefs) {}
40
41 TestingPrefServiceSyncable::TestingPrefServiceSyncable()
42 : TestingPrefServiceBase<PrefServiceSyncable,
43 user_prefs::PrefRegistrySyncable>(
44 new TestingPrefStore(),
45 new TestingPrefStore(),
46 new TestingPrefStore(),
47 new user_prefs::PrefRegistrySyncable(),
48 new PrefNotifierImpl()) {
49 }
50
51 TestingPrefServiceSyncable::TestingPrefServiceSyncable(
52 TestingPrefStore* managed_prefs,
53 TestingPrefStore* user_prefs,
54 TestingPrefStore* recommended_prefs,
55 user_prefs::PrefRegistrySyncable* pref_registry,
56 PrefNotifierImpl* pref_notifier)
57 : TestingPrefServiceBase<PrefServiceSyncable,
58 user_prefs::PrefRegistrySyncable>(
59 managed_prefs,
60 user_prefs,
61 recommended_prefs,
62 pref_registry,
63 pref_notifier) {
64 }
65
66 TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
67 }
68
69 user_prefs::PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
70 return static_cast<user_prefs::PrefRegistrySyncable*>(
71 DeprecatedGetPrefRegistry());
72 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_pref_service_syncable.h ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698