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

Unified Diff: chrome/test/testing_pref_service.cc

Issue 3051001: Adjust preference sync code to only sync user modifiable preferences. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: separate out the download_manager_unittest.cc fixes Created 10 years, 5 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/testing_pref_service.h ('k') | chrome/test/testing_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/testing_pref_service.cc
diff --git a/chrome/test/testing_pref_service.cc b/chrome/test/testing_pref_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e6dde839d66bd62120e8e21a6df2df7487562392
--- /dev/null
+++ b/chrome/test/testing_pref_service.cc
@@ -0,0 +1,60 @@
+// Copyright (c) 2010 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/testing_pref_service.h"
+
+#include "chrome/browser/dummy_pref_store.h"
+#include "chrome/browser/pref_value_store.h"
+
+TestingPrefService::TestingPrefService()
+ : PrefService(new PrefValueStore(
+ managed_prefs_ = new DummyPrefStore(),
+ NULL,
+ NULL,
+ user_prefs_ = new DummyPrefStore(),
+ NULL)) {
+}
+
+const Value* TestingPrefService::GetManagedPref(const wchar_t* path) {
+ return GetPref(managed_prefs_, path);
+}
+
+void TestingPrefService::SetManagedPref(const wchar_t* path, Value* value) {
+ SetPref(managed_prefs_, path, value);
+}
+
+void TestingPrefService::RemoveManagedPref(const wchar_t* path) {
+ RemovePref(managed_prefs_, path);
+}
+
+const Value* TestingPrefService::GetUserPref(const wchar_t* path) {
+ return GetPref(user_prefs_, path);
+}
+
+void TestingPrefService::SetUserPref(const wchar_t* path, Value* value) {
+ SetPref(user_prefs_, path, value);
+}
+
+void TestingPrefService::RemoveUserPref(const wchar_t* path) {
+ RemovePref(user_prefs_, path);
+}
+
+const Value* TestingPrefService::GetPref(PrefStore* pref_store,
+ const wchar_t* path) {
+ Value* result;
+ return pref_store->prefs()->Get(path, &result) ? result : NULL;
+}
+
+void TestingPrefService::SetPref(PrefStore* pref_store,
+ const wchar_t* path,
+ Value* value) {
+ pref_store->prefs()->Set(path, value);
+ FireObservers(path);
+}
+
+void TestingPrefService::RemovePref(PrefStore* pref_store,
+ const wchar_t* path) {
+ pref_store->prefs()->Remove(path, NULL);
+ FireObservers(path);
+}
« no previous file with comments | « chrome/test/testing_pref_service.h ('k') | chrome/test/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698