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_OVERLAY_PERSISTENT_PREF_STORE_H_ | 5 #ifndef CHROME_BROWSER_PREFS_OVERLAY_PERSISTENT_PREF_STORE_H_ |
6 #define CHROME_BROWSER_PREFS_OVERLAY_PERSISTENT_PREF_STORE_H_ | 6 #define CHROME_BROWSER_PREFS_OVERLAY_PERSISTENT_PREF_STORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 virtual ReadResult GetValue(const std::string& key, Value** result) const; | 36 virtual ReadResult GetValue(const std::string& key, Value** result) const; |
37 | 37 |
38 // Methods of PersistentPrefStore. | 38 // Methods of PersistentPrefStore. |
39 virtual void SetValue(const std::string& key, Value* value); | 39 virtual void SetValue(const std::string& key, Value* value); |
40 virtual void SetValueSilently(const std::string& key, Value* value); | 40 virtual void SetValueSilently(const std::string& key, Value* value); |
41 virtual void RemoveValue(const std::string& key); | 41 virtual void RemoveValue(const std::string& key); |
42 virtual bool ReadOnly() const; | 42 virtual bool ReadOnly() const; |
43 virtual PrefReadError ReadPrefs(); | 43 virtual PrefReadError ReadPrefs(); |
44 virtual bool WritePrefs(); | 44 virtual bool WritePrefs(); |
45 virtual void ScheduleWritePrefs(); | 45 virtual void ScheduleWritePrefs(); |
| 46 virtual void CommitPendingWrite(); |
46 // TODO(battre) remove this function | 47 // TODO(battre) remove this function |
47 virtual void ReportValueChanged(const std::string& key); | 48 virtual void ReportValueChanged(const std::string& key); |
48 | 49 |
49 private: | 50 private: |
50 // Methods of PrefStore::Observer. | 51 // Methods of PrefStore::Observer. |
51 virtual void OnPrefValueChanged(const std::string& key); | 52 virtual void OnPrefValueChanged(const std::string& key); |
52 virtual void OnInitializationCompleted(); | 53 virtual void OnInitializationCompleted(); |
53 | 54 |
54 ObserverList<PrefStore::Observer, true> observers_; | 55 ObserverList<PrefStore::Observer, true> observers_; |
55 PrefValueMap overlay_; | 56 PrefValueMap overlay_; |
56 scoped_refptr<PersistentPrefStore> underlay_; | 57 scoped_refptr<PersistentPrefStore> underlay_; |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(OverlayPersistentPrefStore); | 59 DISALLOW_COPY_AND_ASSIGN(OverlayPersistentPrefStore); |
59 }; | 60 }; |
60 | 61 |
61 #endif // CHROME_BROWSER_PREFS_OVERLAY_PERSISTENT_PREF_STORE_H_ | 62 #endif // CHROME_BROWSER_PREFS_OVERLAY_PERSISTENT_PREF_STORE_H_ |
OLD | NEW |