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_COMMON_PREF_STORE_H_ | 5 #ifndef CHROME_COMMON_PREF_STORE_H_ |
6 #define CHROME_COMMON_PREF_STORE_H_ | 6 #define CHROME_COMMON_PREF_STORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class PrefStore : public base::RefCounted<PrefStore> { | 23 class PrefStore : public base::RefCounted<PrefStore> { |
24 public: | 24 public: |
25 // Observer interface for monitoring PrefStore. | 25 // Observer interface for monitoring PrefStore. |
26 class Observer { | 26 class Observer { |
27 public: | 27 public: |
28 virtual ~Observer() {} | 28 virtual ~Observer() {} |
29 | 29 |
30 // Called when the value for the given |key| in the store changes. | 30 // Called when the value for the given |key| in the store changes. |
31 virtual void OnPrefValueChanged(const std::string& key) = 0; | 31 virtual void OnPrefValueChanged(const std::string& key) = 0; |
32 // Notification about the PrefStore being fully initialized. | 32 // Notification about the PrefStore being fully initialized. |
33 virtual void OnInitializationCompleted() = 0; | 33 virtual void OnInitializationCompleted(bool succeeded) = 0; |
34 }; | 34 }; |
35 | 35 |
36 // Return values for GetValue(). | 36 // Return values for GetValue(). |
37 enum ReadResult { | 37 enum ReadResult { |
38 // Value found and returned. | 38 // Value found and returned. |
39 READ_OK, | 39 READ_OK, |
40 // No value present, but skip other pref stores and use default. | 40 // No value present, but skip other pref stores and use default. |
41 READ_USE_DEFAULT, | 41 READ_USE_DEFAULT, |
42 // No value present. | 42 // No value present. |
43 READ_NO_VALUE, | 43 READ_NO_VALUE, |
(...skipping 16 matching lines...) Expand all Loading... |
60 | 60 |
61 protected: | 61 protected: |
62 friend class base::RefCounted<PrefStore>; | 62 friend class base::RefCounted<PrefStore>; |
63 virtual ~PrefStore() {} | 63 virtual ~PrefStore() {} |
64 | 64 |
65 private: | 65 private: |
66 DISALLOW_COPY_AND_ASSIGN(PrefStore); | 66 DISALLOW_COPY_AND_ASSIGN(PrefStore); |
67 }; | 67 }; |
68 | 68 |
69 #endif // CHROME_COMMON_PREF_STORE_H_ | 69 #endif // CHROME_COMMON_PREF_STORE_H_ |
OLD | NEW |