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

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: Addressed comments, moved ExtensionPrefStore reference to Profile 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
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"
(...skipping 18 matching lines...) Expand all
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,
33 user_prefs_ = new DummyPrefStore(), 33 user_prefs_ = new DummyPrefStore(),
34 NULL, 34 NULL,
35 default_prefs_ = new DummyPrefStore())) { 35 default_prefs_ = new DummyPrefStore())) {
36 } 36 }
37 37
38 TestingPrefService::TestingPrefService( 38 TestingPrefService::TestingPrefService(
39 PrefStore* managed_platform_prefs,
40 PrefStore* device_management_prefs,
41 PrefStore* extension_prefs,
42 PrefStore* command_line_prefs,
43 PrefStore* user_prefs,
44 PrefStore* recommended_prefs,
45 PrefStore* default_prefs)
46 : PrefService(new TestingPrefValueStore(
47 managed_platform_prefs_ = managed_platform_prefs,
Mattias Nissler (ping if slow) 2010/12/01 10:36:36 I'd expect two spaces more indentation here, becau
battre (please use the other) 2010/12/01 17:44:38 I agree. Done.
48 device_management_prefs_ = device_management_prefs,
49 extension_prefs,
50 command_line_prefs,
51 user_prefs_ = user_prefs,
52 recommended_prefs,
53 default_prefs_ = default_prefs)) {
54 }
55
56 TestingPrefService::TestingPrefService(
39 policy::ConfigurationPolicyProvider* managed_platform_provider, 57 policy::ConfigurationPolicyProvider* managed_platform_provider,
40 policy::ConfigurationPolicyProvider* device_management_provider, 58 policy::ConfigurationPolicyProvider* device_management_provider,
41 CommandLine* command_line) 59 CommandLine* command_line)
42 : PrefService(new TestingPrefValueStore( 60 : PrefService(new TestingPrefValueStore(
43 managed_platform_prefs_ = CreatePolicyPrefStoreFromProvider( 61 managed_platform_prefs_ = CreatePolicyPrefStoreFromProvider(
44 managed_platform_provider), 62 managed_platform_provider),
45 device_management_prefs_ = 63 device_management_prefs_ =
46 CreatePolicyPrefStoreFromProvider(device_management_provider), 64 CreatePolicyPrefStoreFromProvider(device_management_provider),
47 NULL, 65 NULL,
48 CreateCommandLinePrefStore(command_line), 66 CreateCommandLinePrefStore(command_line),
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 Value* value) { 128 Value* value) {
111 pref_store->prefs()->Set(path, value); 129 pref_store->prefs()->Set(path, value);
112 pref_notifier()->FireObservers(path); 130 pref_notifier()->FireObservers(path);
113 } 131 }
114 132
115 void TestingPrefService::RemovePref(PrefStore* pref_store, 133 void TestingPrefService::RemovePref(PrefStore* pref_store,
116 const char* path) { 134 const char* path) {
117 pref_store->prefs()->Remove(path, NULL); 135 pref_store->prefs()->Remove(path, NULL);
118 pref_notifier()->FireObservers(path); 136 pref_notifier()->FireObservers(path);
119 } 137 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698