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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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/testing_pref_service.h"
6
7 #include "chrome/browser/dummy_pref_store.h"
8 #include "chrome/browser/pref_value_store.h"
9
10 TestingPrefService::TestingPrefService()
11 : PrefService(new PrefValueStore(
12 managed_prefs_ = new DummyPrefStore(),
13 NULL,
14 NULL,
15 user_prefs_ = new DummyPrefStore(),
16 NULL)) {
17 }
18
19 const Value* TestingPrefService::GetManagedPref(const wchar_t* path) {
20 return GetPref(managed_prefs_, path);
21 }
22
23 void TestingPrefService::SetManagedPref(const wchar_t* path, Value* value) {
24 SetPref(managed_prefs_, path, value);
25 }
26
27 void TestingPrefService::RemoveManagedPref(const wchar_t* path) {
28 RemovePref(managed_prefs_, path);
29 }
30
31 const Value* TestingPrefService::GetUserPref(const wchar_t* path) {
32 return GetPref(user_prefs_, path);
33 }
34
35 void TestingPrefService::SetUserPref(const wchar_t* path, Value* value) {
36 SetPref(user_prefs_, path, value);
37 }
38
39 void TestingPrefService::RemoveUserPref(const wchar_t* path) {
40 RemovePref(user_prefs_, path);
41 }
42
43 const Value* TestingPrefService::GetPref(PrefStore* pref_store,
44 const wchar_t* path) {
45 Value* result;
46 return pref_store->prefs()->Get(path, &result) ? result : NULL;
47 }
48
49 void TestingPrefService::SetPref(PrefStore* pref_store,
50 const wchar_t* path,
51 Value* value) {
52 pref_store->prefs()->Set(path, value);
53 FireObservers(path);
54 }
55
56 void TestingPrefService::RemovePref(PrefStore* pref_store,
57 const wchar_t* path) {
58 pref_store->prefs()->Remove(path, NULL);
59 FireObservers(path);
60 }
OLDNEW
« 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