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

Unified Diff: chrome/test/base/testing_pref_service_syncable.cc

Issue 12223091: Split testing_pref_service.h/.cc into two parts, generic vs. Chrome-specific. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comment. Created 7 years, 10 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_pref_service_syncable.cc
diff --git a/chrome/test/base/testing_pref_service_syncable.cc b/chrome/test/base/testing_pref_service_syncable.cc
new file mode 100644
index 0000000000000000000000000000000000000000..94b5fe578e02fadc3d476bf5fe229c51ba110512
--- /dev/null
+++ b/chrome/test/base/testing_pref_service_syncable.cc
@@ -0,0 +1,55 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/base/testing_pref_service_syncable.h"
+
+#include "base/bind.h"
+#include "base/prefs/pref_notifier_impl.h"
+#include "base/prefs/pref_value_store.h"
+#include "chrome/browser/prefs/pref_registry_syncable.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+template<>
+TestingPrefServiceBase<PrefServiceSyncable, PrefRegistrySyncable>::
+TestingPrefServiceBase(TestingPrefStore* managed_prefs,
+ TestingPrefStore* user_prefs,
+ TestingPrefStore* recommended_prefs,
+ PrefRegistrySyncable* pref_registry,
+ PrefNotifierImpl* pref_notifier)
+ : PrefServiceSyncable(
+ pref_notifier,
+ new PrefValueStore(
+ managed_prefs,
+ NULL,
+ NULL,
+ user_prefs,
+ recommended_prefs,
+ pref_registry->defaults(),
+ pref_notifier),
+ user_prefs,
+ pref_registry,
+ base::Bind(
+ &TestingPrefServiceBase<PrefServiceSyncable,
+ PrefRegistrySyncable>::HandleReadError),
+ false),
+ managed_prefs_(managed_prefs),
+ user_prefs_(user_prefs),
+ recommended_prefs_(recommended_prefs) {
+}
+
+TestingPrefServiceSyncable::TestingPrefServiceSyncable()
+ : TestingPrefServiceBase<PrefServiceSyncable, PrefRegistrySyncable>(
+ new TestingPrefStore(),
+ new TestingPrefStore(),
+ new TestingPrefStore(),
+ new PrefRegistrySyncable(),
+ new PrefNotifierImpl()) {
+}
+
+TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
+}
+
+PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
+ return static_cast<PrefRegistrySyncable*>(DeprecatedGetPrefRegistry());
+}
« 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