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

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

Issue 5174006: Move DeviceManagementPolicyProvider into the profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback. Created 10 years, 1 month 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
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/prefs/command_line_pref_store.h" 7 #include "chrome/browser/prefs/command_line_pref_store.h"
8 #include "chrome/browser/prefs/dummy_pref_store.h" 8 #include "chrome/browser/prefs/dummy_pref_store.h"
9 #include "chrome/browser/prefs/pref_value_store.h" 9 #include "chrome/browser/prefs/pref_value_store.h"
10 #include "chrome/browser/policy/configuration_policy_pref_store.h" 10 #include "chrome/browser/policy/configuration_policy_pref_store.h"
11 11
12 TestingPrefService::TestingPrefValueStore::TestingPrefValueStore( 12 TestingPrefService::TestingPrefValueStore::TestingPrefValueStore(
13 PrefStore* managed_platform_prefs, 13 PrefStore* managed_platform_prefs,
14 PrefStore* device_management_prefs, 14 PrefStore* device_management_prefs,
15 PrefStore* extension_prefs, 15 PrefStore* extension_prefs,
16 PrefStore* command_line_prefs, 16 PrefStore* command_line_prefs,
17 PrefStore* user_prefs, 17 PrefStore* user_prefs,
18 PrefStore* recommended_prefs, 18 PrefStore* recommended_prefs,
19 PrefStore* default_prefs) 19 PrefStore* default_prefs)
20 : PrefValueStore(managed_platform_prefs, device_management_prefs, 20 : PrefValueStore(managed_platform_prefs, device_management_prefs,
21 extension_prefs, command_line_prefs, 21 extension_prefs, command_line_prefs,
22 user_prefs, recommended_prefs, default_prefs) { 22 user_prefs, recommended_prefs, default_prefs, NULL) {
23 } 23 }
24 24
25 // TODO(pamg): Instantiate no PrefStores by default. Allow callers to specify 25 // TODO(pamg): Instantiate no PrefStores by default. Allow callers to specify
26 // which they want, and expand usage of this class to more unit tests. 26 // which they want, and expand usage of this class to more unit tests.
27 TestingPrefService::TestingPrefService() 27 TestingPrefService::TestingPrefService()
28 : PrefService(new TestingPrefValueStore( 28 : PrefService(new TestingPrefValueStore(
29 managed_platform_prefs_ = new DummyPrefStore(), 29 managed_platform_prefs_ = new DummyPrefStore(),
30 device_management_prefs_ = new DummyPrefStore(), 30 device_management_prefs_ = new DummyPrefStore(),
31 NULL, 31 NULL,
32 NULL, 32 NULL,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 Value* value) { 110 Value* value) {
111 pref_store->prefs()->Set(path, value); 111 pref_store->prefs()->Set(path, value);
112 pref_notifier()->FireObservers(path); 112 pref_notifier()->FireObservers(path);
113 } 113 }
114 114
115 void TestingPrefService::RemovePref(PrefStore* pref_store, 115 void TestingPrefService::RemovePref(PrefStore* pref_store,
116 const char* path) { 116 const char* path) {
117 pref_store->prefs()->Remove(path, NULL); 117 pref_store->prefs()->Remove(path, NULL);
118 pref_notifier()->FireObservers(path); 118 pref_notifier()->FireObservers(path);
119 } 119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698