OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYNCED_PREF_CHANGE_REGISTRAR_H_ | 5 #ifndef CHROME_BROWSER_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ |
6 #define CHROME_BROWSER_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ | 6 #define CHROME_BROWSER_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Remove all registered observers. | 38 // Remove all registered observers. |
39 void RemoveAll(); | 39 void RemoveAll(); |
40 | 40 |
41 // Indicates whether or not an observer is already registered for |path|. | 41 // Indicates whether or not an observer is already registered for |path|. |
42 bool IsObserved(const char* path) const; | 42 bool IsObserved(const char* path) const; |
43 | 43 |
44 private: | 44 private: |
45 // SyncedPrefObserver implementation | 45 // SyncedPrefObserver implementation |
46 virtual void OnSyncedPrefChanged(const std::string& path, bool from_sync) | 46 virtual void OnSyncedPrefChanged(const std::string& path, bool from_sync) |
47 OVERRIDE; | 47 override; |
48 | 48 |
49 typedef std::map<std::string, NamedChangeCallback> ObserverMap; | 49 typedef std::map<std::string, NamedChangeCallback> ObserverMap; |
50 | 50 |
51 PrefServiceSyncable* pref_service_; | 51 PrefServiceSyncable* pref_service_; |
52 ObserverMap observers_; | 52 ObserverMap observers_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(SyncedPrefChangeRegistrar); | 54 DISALLOW_COPY_AND_ASSIGN(SyncedPrefChangeRegistrar); |
55 }; | 55 }; |
56 | 56 |
57 #endif // CHROME_BROWSER_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ | 57 #endif // CHROME_BROWSER_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ |
OLD | NEW |