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

Side by Side Diff: chrome/test/testing_pref_service.cc

Issue 3032058: Move creation of the PrefStores into the PrefValueStore, to reduce the knowle... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Comment-only changes Created 10 years, 4 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/testing_pref_service.h" 5 #include "chrome/test/testing_pref_service.h"
6 6
7 #include "chrome/browser/dummy_pref_store.h" 7 #include "chrome/browser/dummy_pref_store.h"
8 #include "chrome/browser/pref_value_store.h" 8 #include "chrome/browser/pref_value_store.h"
9 9
10 TestingPrefService::TestingPrefValueStore::TestingPrefValueStore(
11 PrefStore* managed_prefs,
12 PrefStore* extension_prefs,
13 PrefStore* command_line_prefs,
14 PrefStore* user_prefs,
15 PrefStore* recommended_prefs)
16 : PrefValueStore(managed_prefs, extension_prefs, command_line_prefs,
17 user_prefs, recommended_prefs) {
18 }
19
20 // TODO(pamg): Instantiate no PrefStores by default. Allow callers to specify
21 // which they want, and expand usage of this class to more unit tests.
10 TestingPrefService::TestingPrefService() 22 TestingPrefService::TestingPrefService()
11 : PrefService(new PrefValueStore( 23 : PrefService(new TestingPrefValueStore(
12 managed_prefs_ = new DummyPrefStore(), 24 managed_prefs_ = new DummyPrefStore(),
13 NULL, 25 NULL,
14 NULL, 26 NULL,
15 user_prefs_ = new DummyPrefStore(), 27 user_prefs_ = new DummyPrefStore(),
16 NULL)) { 28 NULL)) {
17 } 29 }
18 30
19 const Value* TestingPrefService::GetManagedPref(const wchar_t* path) { 31 const Value* TestingPrefService::GetManagedPref(const wchar_t* path) {
20 return GetPref(managed_prefs_, path); 32 return GetPref(managed_prefs_, path);
21 } 33 }
(...skipping 29 matching lines...) Expand all
51 Value* value) { 63 Value* value) {
52 pref_store->prefs()->Set(path, value); 64 pref_store->prefs()->Set(path, value);
53 FireObservers(path); 65 FireObservers(path);
54 } 66 }
55 67
56 void TestingPrefService::RemovePref(PrefStore* pref_store, 68 void TestingPrefService::RemovePref(PrefStore* pref_store,
57 const wchar_t* path) { 69 const wchar_t* path) {
58 pref_store->prefs()->Remove(path, NULL); 70 pref_store->prefs()->Remove(path, NULL);
59 FireObservers(path); 71 FireObservers(path);
60 } 72 }
OLDNEW
« chrome/browser/pref_value_store.cc ('K') | « chrome/test/testing_pref_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698