| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_PREFS_TESTING_PREF_STORE_H_ | 5 #ifndef CHROME_BROWSER_PREFS_TESTING_PREF_STORE_H_ |
| 6 #define CHROME_BROWSER_PREFS_TESTING_PREF_STORE_H_ | 6 #define CHROME_BROWSER_PREFS_TESTING_PREF_STORE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Overriden from PrefStore. | 23 // Overriden from PrefStore. |
| 24 virtual ReadResult GetValue(const std::string& key, | 24 virtual ReadResult GetValue(const std::string& key, |
| 25 const base::Value** result) const; | 25 const base::Value** result) const; |
| 26 virtual void AddObserver(PrefStore::Observer* observer); | 26 virtual void AddObserver(PrefStore::Observer* observer); |
| 27 virtual void RemoveObserver(PrefStore::Observer* observer); | 27 virtual void RemoveObserver(PrefStore::Observer* observer); |
| 28 virtual bool IsInitializationComplete() const; | 28 virtual bool IsInitializationComplete() const; |
| 29 | 29 |
| 30 // PersistentPrefStore overrides: | 30 // PersistentPrefStore overrides: |
| 31 virtual ReadResult GetMutableValue(const std::string& key, | 31 virtual ReadResult GetMutableValue(const std::string& key, |
| 32 base::Value** result) OVERRIDE; | 32 base::Value** result); |
| 33 virtual void ReportValueChanged(const std::string& key) OVERRIDE; | 33 virtual void ReportValueChanged(const std::string& key); |
| 34 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE; | 34 virtual void SetValue(const std::string& key, base::Value* value); |
| 35 virtual void SetValueSilently(const std::string& key, | 35 virtual void SetValueSilently(const std::string& key, base::Value* value); |
| 36 base::Value* value) OVERRIDE; | 36 virtual void RemoveValue(const std::string& key); |
| 37 virtual void RemoveValue(const std::string& key) OVERRIDE; | 37 virtual bool ReadOnly() const; |
| 38 virtual bool ReadOnly() const OVERRIDE; | 38 virtual PersistentPrefStore::PrefReadError ReadPrefs(); |
| 39 virtual PersistentPrefStore::PrefReadError ReadPrefs() OVERRIDE; | 39 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate); |
| 40 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE; | 40 virtual bool WritePrefs(); |
| 41 virtual bool WritePrefs() OVERRIDE; | 41 virtual void ScheduleWritePrefs() {} |
| 42 virtual void ScheduleWritePrefs() OVERRIDE {} | 42 virtual void CommitPendingWrite() {} |
| 43 virtual void CommitPendingWrite() OVERRIDE {} | |
| 44 virtual void CheckIfValueDestroyed(const std::string& key) OVERRIDE {} | |
| 45 | 43 |
| 46 // Marks the store as having completed initialization. | 44 // Marks the store as having completed initialization. |
| 47 void SetInitializationCompleted(); | 45 void SetInitializationCompleted(); |
| 48 | 46 |
| 49 // Used for tests to trigger notifications explicitly. | 47 // Used for tests to trigger notifications explicitly. |
| 50 void NotifyPrefValueChanged(const std::string& key); | 48 void NotifyPrefValueChanged(const std::string& key); |
| 51 void NotifyInitializationCompleted(); | 49 void NotifyInitializationCompleted(); |
| 52 | 50 |
| 53 // Some convenience getters/setters. | 51 // Some convenience getters/setters. |
| 54 void SetString(const std::string& key, const std::string& value); | 52 void SetString(const std::string& key, const std::string& value); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 77 | 75 |
| 78 // Whether initialization has been completed. | 76 // Whether initialization has been completed. |
| 79 bool init_complete_; | 77 bool init_complete_; |
| 80 | 78 |
| 81 ObserverList<PrefStore::Observer, true> observers_; | 79 ObserverList<PrefStore::Observer, true> observers_; |
| 82 | 80 |
| 83 DISALLOW_COPY_AND_ASSIGN(TestingPrefStore); | 81 DISALLOW_COPY_AND_ASSIGN(TestingPrefStore); |
| 84 }; | 82 }; |
| 85 | 83 |
| 86 #endif // CHROME_BROWSER_PREFS_TESTING_PREF_STORE_H_ | 84 #endif // CHROME_BROWSER_PREFS_TESTING_PREF_STORE_H_ |
| OLD | NEW |