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 COMPONENTS_SYNCABLE_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ | 5 #ifndef COMPONENTS_SYNCABLE_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ |
6 #define COMPONENTS_SYNCABLE_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ | 6 #define COMPONENTS_SYNCABLE_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" |
12 #include "components/syncable_prefs/pref_service_syncable.h" | 13 #include "components/syncable_prefs/pref_service_syncable.h" |
13 #include "components/syncable_prefs/synced_pref_observer.h" | 14 #include "components/syncable_prefs/synced_pref_observer.h" |
14 | 15 |
15 namespace syncable_prefs { | 16 namespace syncable_prefs { |
16 | 17 |
17 // Manages the registration of one or more SyncedPrefObservers on a | 18 // Manages the registration of one or more SyncedPrefObservers on a |
18 // PrefServiceSyncable. This is modeled after base::PrefChangeRegistrar, and | 19 // PrefServiceSyncable. This is modeled after base::PrefChangeRegistrar, and |
19 // it should be used whenever it's necessary to determine whether a pref change | 20 // it should be used whenever it's necessary to determine whether a pref change |
20 // has come from sync or from some other mechanism (managed, UI, external, etc.) | 21 // has come from sync or from some other mechanism (managed, UI, external, etc.) |
21 class SyncedPrefChangeRegistrar : public SyncedPrefObserver { | 22 class SyncedPrefChangeRegistrar : public SyncedPrefObserver { |
(...skipping 29 matching lines...) Expand all Loading... |
51 | 52 |
52 PrefServiceSyncable* pref_service_; | 53 PrefServiceSyncable* pref_service_; |
53 ObserverMap observers_; | 54 ObserverMap observers_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(SyncedPrefChangeRegistrar); | 56 DISALLOW_COPY_AND_ASSIGN(SyncedPrefChangeRegistrar); |
56 }; | 57 }; |
57 | 58 |
58 } // namespace syncable_prefs | 59 } // namespace syncable_prefs |
59 | 60 |
60 #endif // COMPONENTS_SYNCABLE_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ | 61 #endif // COMPONENTS_SYNCABLE_PREFS_SYNCED_PREF_CHANGE_REGISTRAR_H_ |
OLD | NEW |