| OLD | NEW |
| 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 #ifndef CHROME_TEST_TESTING_PREF_SERVICE_H_ | 5 #ifndef CHROME_TEST_TESTING_PREF_SERVICE_H_ |
| 6 #define CHROME_TEST_TESTING_PREF_SERVICE_H_ | 6 #define CHROME_TEST_TESTING_PREF_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <chrome/browser/pref_service.h> | 9 #include "chrome/browser/pref_service.h" |
| 10 | 10 |
| 11 // A PrefService subclass for testing. It operates totally in memory and | 11 // A PrefService subclass for testing. It operates totally in memory and |
| 12 // provides additional API for manipulating preferences at the different levels | 12 // provides additional API for manipulating preferences at the different levels |
| 13 // (managed, extension, user) conveniently. | 13 // (managed, extension, user) conveniently. |
| 14 class TestingPrefService : public PrefService { | 14 class TestingPrefService : public PrefService { |
| 15 public: | 15 public: |
| 16 // Create an empty instance. | 16 // Create an empty instance. |
| 17 TestingPrefService(); | 17 TestingPrefService(); |
| 18 | 18 |
| 19 // Read the value of a preference from the managed layer. Returns NULL if the | 19 // Read the value of a preference from the managed layer. Returns NULL if the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // Sets the value for |path| in |pref_store|. | 41 // Sets the value for |path| in |pref_store|. |
| 42 void SetPref(PrefStore* pref_store, const wchar_t* path, Value* value); | 42 void SetPref(PrefStore* pref_store, const wchar_t* path, Value* value); |
| 43 | 43 |
| 44 // Removes the preference identified by |path| from |pref_store|. | 44 // Removes the preference identified by |path| from |pref_store|. |
| 45 void RemovePref(PrefStore* pref_store, const wchar_t* path); | 45 void RemovePref(PrefStore* pref_store, const wchar_t* path); |
| 46 | 46 |
| 47 // Pointers to the pref stores our value store uses. | 47 // Pointers to the pref stores our value store uses. |
| 48 PrefStore* managed_prefs_; | 48 PrefStore* managed_prefs_; |
| 49 PrefStore* user_prefs_; | 49 PrefStore* user_prefs_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(TestingPrefService); |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 #endif // CHROME_TEST_TESTING_PREF_SERVICE_H_ | 54 #endif // CHROME_TEST_TESTING_PREF_SERVICE_H_ |
| OLD | NEW |