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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 scoped_refptr<TestingPrefStore> recommended_prefs_; | 77 scoped_refptr<TestingPrefStore> recommended_prefs_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceBase); | 79 DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceBase); |
80 }; | 80 }; |
81 | 81 |
82 // Test version of PrefService. | 82 // Test version of PrefService. |
83 class TestingPrefServiceSimple | 83 class TestingPrefServiceSimple |
84 : public TestingPrefServiceBase<PrefService, PrefRegistry> { | 84 : public TestingPrefServiceBase<PrefService, PrefRegistry> { |
85 public: | 85 public: |
86 TestingPrefServiceSimple(); | 86 TestingPrefServiceSimple(); |
87 virtual ~TestingPrefServiceSimple(); | 87 ~TestingPrefServiceSimple() override; |
88 | 88 |
89 // This is provided as a convenience for registering preferences on | 89 // This is provided as a convenience for registering preferences on |
90 // an existing TestingPrefServiceSimple instance. On a production | 90 // an existing TestingPrefServiceSimple instance. On a production |
91 // PrefService you would do all registrations before constructing | 91 // PrefService you would do all registrations before constructing |
92 // it, passing it a PrefRegistry via its constructor (or via | 92 // it, passing it a PrefRegistry via its constructor (or via |
93 // e.g. PrefServiceFactory). | 93 // e.g. PrefServiceFactory). |
94 PrefRegistrySimple* registry(); | 94 PrefRegistrySimple* registry(); |
95 | 95 |
96 private: | 96 private: |
97 DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceSimple); | 97 DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceSimple); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 template<class SuperPrefService, class ConstructionPrefRegistry> | 191 template<class SuperPrefService, class ConstructionPrefRegistry> |
192 void TestingPrefServiceBase< | 192 void TestingPrefServiceBase< |
193 SuperPrefService, ConstructionPrefRegistry>::RemovePref( | 193 SuperPrefService, ConstructionPrefRegistry>::RemovePref( |
194 TestingPrefStore* pref_store, const char* path) { | 194 TestingPrefStore* pref_store, const char* path) { |
195 pref_store->RemoveValue(path); | 195 pref_store->RemoveValue(path); |
196 } | 196 } |
197 | 197 |
198 #endif // BASE_PREFS_TESTING_PREF_SERVICE_H_ | 198 #endif // BASE_PREFS_TESTING_PREF_SERVICE_H_ |
OLD | NEW |