| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef BASE_PREFS_TESTING_PREF_SERVICE_H_ | 5 #ifndef BASE_PREFS_TESTING_PREF_SERVICE_H_ |
| 6 #define BASE_PREFS_TESTING_PREF_SERVICE_H_ | 6 #define BASE_PREFS_TESTING_PREF_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/prefs/pref_registry.h" | 10 #include "base/prefs/pref_registry.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void TestingPrefServiceBase< | 161 void TestingPrefServiceBase< |
| 162 SuperPrefService, ConstructionPrefRegistry>::SetRecommendedPref( | 162 SuperPrefService, ConstructionPrefRegistry>::SetRecommendedPref( |
| 163 const char* path, Value* value) { | 163 const char* path, Value* value) { |
| 164 SetPref(recommended_prefs_.get(), path, value); | 164 SetPref(recommended_prefs_.get(), path, value); |
| 165 } | 165 } |
| 166 | 166 |
| 167 template<class SuperPrefService, class ConstructionPrefRegistry> | 167 template<class SuperPrefService, class ConstructionPrefRegistry> |
| 168 void TestingPrefServiceBase< | 168 void TestingPrefServiceBase< |
| 169 SuperPrefService, ConstructionPrefRegistry>::RemoveRecommendedPref( | 169 SuperPrefService, ConstructionPrefRegistry>::RemoveRecommendedPref( |
| 170 const char* path) { | 170 const char* path) { |
| 171 RemovePref(recommended_prefs_, path); | 171 RemovePref(recommended_prefs_.get(), path); |
| 172 } | 172 } |
| 173 | 173 |
| 174 template<class SuperPrefService, class ConstructionPrefRegistry> | 174 template<class SuperPrefService, class ConstructionPrefRegistry> |
| 175 const Value* TestingPrefServiceBase< | 175 const Value* TestingPrefServiceBase< |
| 176 SuperPrefService, ConstructionPrefRegistry>::GetPref( | 176 SuperPrefService, ConstructionPrefRegistry>::GetPref( |
| 177 TestingPrefStore* pref_store, const char* path) const { | 177 TestingPrefStore* pref_store, const char* path) const { |
| 178 const Value* res; | 178 const Value* res; |
| 179 return pref_store->GetValue(path, &res) ? res : NULL; | 179 return pref_store->GetValue(path, &res) ? res : NULL; |
| 180 } | 180 } |
| 181 | 181 |
| 182 template<class SuperPrefService, class ConstructionPrefRegistry> | 182 template<class SuperPrefService, class ConstructionPrefRegistry> |
| 183 void TestingPrefServiceBase< | 183 void TestingPrefServiceBase< |
| 184 SuperPrefService, ConstructionPrefRegistry>::SetPref( | 184 SuperPrefService, ConstructionPrefRegistry>::SetPref( |
| 185 TestingPrefStore* pref_store, const char* path, Value* value) { | 185 TestingPrefStore* pref_store, const char* path, Value* value) { |
| 186 pref_store->SetValue(path, value); | 186 pref_store->SetValue(path, value); |
| 187 } | 187 } |
| 188 | 188 |
| 189 template<class SuperPrefService, class ConstructionPrefRegistry> | 189 template<class SuperPrefService, class ConstructionPrefRegistry> |
| 190 void TestingPrefServiceBase< | 190 void TestingPrefServiceBase< |
| 191 SuperPrefService, ConstructionPrefRegistry>::RemovePref( | 191 SuperPrefService, ConstructionPrefRegistry>::RemovePref( |
| 192 TestingPrefStore* pref_store, const char* path) { | 192 TestingPrefStore* pref_store, const char* path) { |
| 193 pref_store->RemoveValue(path); | 193 pref_store->RemoveValue(path); |
| 194 } | 194 } |
| 195 | 195 |
| 196 #endif // BASE_PREFS_TESTING_PREF_SERVICE_H_ | 196 #endif // BASE_PREFS_TESTING_PREF_SERVICE_H_ |
| OLD | NEW |