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 BASE_PREFS_PREF_CHANGE_REGISTRAR_H_ | 5 #ifndef BASE_PREFS_PREF_CHANGE_REGISTRAR_H_ |
6 #define BASE_PREFS_PREF_CHANGE_REGISTRAR_H_ | 6 #define BASE_PREFS_PREF_CHANGE_REGISTRAR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Check whether any of the observed preferences has the managed bit set. | 58 // Check whether any of the observed preferences has the managed bit set. |
59 bool IsManaged(); | 59 bool IsManaged(); |
60 | 60 |
61 // Return the PrefService for this registrar. | 61 // Return the PrefService for this registrar. |
62 PrefService* prefs(); | 62 PrefService* prefs(); |
63 const PrefService* prefs() const; | 63 const PrefService* prefs() const; |
64 | 64 |
65 private: | 65 private: |
66 // PrefObserver: | 66 // PrefObserver: |
67 virtual void OnPreferenceChanged(PrefService* service, | 67 void OnPreferenceChanged(PrefService* service, |
68 const std::string& pref_name) OVERRIDE; | 68 const std::string& pref_name) override; |
69 | 69 |
70 static void InvokeUnnamedCallback(const base::Closure& callback, | 70 static void InvokeUnnamedCallback(const base::Closure& callback, |
71 const std::string& pref_name); | 71 const std::string& pref_name); |
72 | 72 |
73 typedef std::map<std::string, NamedChangeCallback> ObserverMap; | 73 typedef std::map<std::string, NamedChangeCallback> ObserverMap; |
74 | 74 |
75 ObserverMap observers_; | 75 ObserverMap observers_; |
76 PrefService* service_; | 76 PrefService* service_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(PrefChangeRegistrar); | 78 DISALLOW_COPY_AND_ASSIGN(PrefChangeRegistrar); |
79 }; | 79 }; |
80 | 80 |
81 #endif // BASE_PREFS_PREF_CHANGE_REGISTRAR_H_ | 81 #endif // BASE_PREFS_PREF_CHANGE_REGISTRAR_H_ |
OLD | NEW |