Fix emulator build error
[platform/framework/web/chromium-efl.git] / components / prefs / testing_pref_service.cc
1 // Copyright 2012 The Chromium Authors
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 "components/prefs/testing_pref_service.h"
6
7 #include <memory>
8
9 #include "base/compiler_specific.h"
10 #include "base/functional/bind.h"
11 #include "components/prefs/default_pref_store.h"
12 #include "components/prefs/pref_notifier_impl.h"
13 #include "components/prefs/pref_registry_simple.h"
14 #include "components/prefs/pref_value_store.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16
17 template <>
18 TestingPrefServiceBase<PrefService, PrefRegistry>::TestingPrefServiceBase(
19     TestingPrefStore* managed_prefs,
20     TestingPrefStore* supervised_user_prefs,
21     TestingPrefStore* extension_prefs,
22     TestingPrefStore* standalone_browser_prefs,
23     TestingPrefStore* user_prefs,
24     TestingPrefStore* recommended_prefs,
25     PrefRegistry* pref_registry,
26     PrefNotifierImpl* pref_notifier)
27     : PrefService(
28           std::unique_ptr<PrefNotifierImpl>(pref_notifier),
29           std::make_unique<PrefValueStore>(managed_prefs,
30                                            supervised_user_prefs,
31                                            extension_prefs,
32                                            standalone_browser_prefs,
33                                            /*command_line_prefs=*/nullptr,
34                                            user_prefs,
35                                            recommended_prefs,
36                                            pref_registry->defaults().get(),
37                                            pref_notifier),
38           user_prefs,
39           standalone_browser_prefs,
40           pref_registry,
41           base::BindRepeating(
42               &TestingPrefServiceBase<PrefService,
43                                       PrefRegistry>::HandleReadError),
44           false),
45       managed_prefs_(managed_prefs),
46       supervised_user_prefs_(supervised_user_prefs),
47       extension_prefs_(extension_prefs),
48       standalone_browser_prefs_(standalone_browser_prefs),
49       user_prefs_(user_prefs),
50       recommended_prefs_(recommended_prefs) {}
51
52 TestingPrefServiceSimple::TestingPrefServiceSimple()
53     : TestingPrefServiceBase<PrefService, PrefRegistry>(
54           /*managed_prefs=*/new TestingPrefStore(),
55           /*supervised_user_prefs=*/new TestingPrefStore(),
56           /*extension_prefs=*/new TestingPrefStore(),
57           /*standalone_browser_prefs=*/new TestingPrefStore(),
58           /*user_prefs=*/new TestingPrefStore(),
59           /*recommended_prefs=*/new TestingPrefStore(),
60           new PrefRegistrySimple(),
61           new PrefNotifierImpl()) {}
62
63 TestingPrefServiceSimple::~TestingPrefServiceSimple() {
64 }
65
66 PrefRegistrySimple* TestingPrefServiceSimple::registry() {
67   return static_cast<PrefRegistrySimple*>(DeprecatedGetPrefRegistry());
68 }