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

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

Issue 5213002: Fix for Bug 50726 "Save extension list and "winning" prefs from extensions" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Same patch but without stuff that is already included in 5204006 Created 10 years 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
« no previous file with comments | « chrome/chrome_tests.gypi ('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
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 #include "chrome/test/testing_pref_value_store.h" 11 #include "chrome/test/testing_pref_value_store.h"
12 12
13 // TODO(pamg): Instantiate no PrefStores by default. Allow callers to specify 13 // TODO(pamg): Instantiate no PrefStores by default. Allow callers to specify
14 // which they want, and expand usage of this class to more unit tests. 14 // which they want, and expand usage of this class to more unit tests.
15 TestingPrefService::TestingPrefService() 15 TestingPrefService::TestingPrefService()
16 : PrefService(new TestingPrefValueStore( 16 : PrefService(new TestingPrefValueStore(
17 managed_platform_prefs_ = new DummyPrefStore(), 17 managed_platform_prefs_ = new DummyPrefStore(),
18 device_management_prefs_ = new DummyPrefStore(), 18 device_management_prefs_ = new DummyPrefStore(),
19 NULL, 19 NULL,
20 NULL, 20 NULL,
21 user_prefs_ = new DummyPrefStore(), 21 user_prefs_ = new DummyPrefStore(),
22 NULL, 22 NULL,
23 default_prefs_ = new DummyPrefStore())) { 23 default_prefs_ = new DummyPrefStore())) {
24 } 24 }
25 25
26 TestingPrefService::TestingPrefService( 26 TestingPrefService::TestingPrefService(
27 policy::ConfigurationPolicyProvider* managed_platform_provider, 27 policy::ConfigurationPolicyProvider* managed_platform_provider,
28 policy::ConfigurationPolicyProvider* device_management_provider, 28 policy::ConfigurationPolicyProvider* device_management_provider,
29 CommandLine* command_line) 29 CommandLine* command_line)
30 : PrefService(new TestingPrefValueStore( 30 : PrefService(new TestingPrefValueStore(
31 managed_platform_prefs_ = CreatePolicyPrefStoreFromProvider( 31 managed_platform_prefs_ = CreatePolicyPrefStoreFromProvider(
32 managed_platform_provider), 32 managed_platform_provider),
33 device_management_prefs_ = 33 device_management_prefs_ =
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 Value* value) { 98 Value* value) {
99 pref_store->prefs()->Set(path, value); 99 pref_store->prefs()->Set(path, value);
100 pref_notifier()->FireObservers(path); 100 pref_notifier()->FireObservers(path);
101 } 101 }
102 102
103 void TestingPrefService::RemovePref(PrefStore* pref_store, 103 void TestingPrefService::RemovePref(PrefStore* pref_store,
104 const char* path) { 104 const char* path) {
105 pref_store->prefs()->Remove(path, NULL); 105 pref_store->prefs()->Remove(path, NULL);
106 pref_notifier()->FireObservers(path); 106 pref_notifier()->FireObservers(path);
107 } 107 }
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698