OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ | 5 #ifndef UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ |
6 #define UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ | 6 #define UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 private: | 74 private: |
75 friend class ScopedEventDispatcher; | 75 friend class ScopedEventDispatcher; |
76 static PlatformEventSource* instance_; | 76 static PlatformEventSource* instance_; |
77 | 77 |
78 // This is invoked when the list of dispatchers changes (i.e. a new dispatcher | 78 // This is invoked when the list of dispatchers changes (i.e. a new dispatcher |
79 // is added, or a dispatcher is removed). | 79 // is added, or a dispatcher is removed). |
80 virtual void OnDispatcherListChanged(); | 80 virtual void OnDispatcherListChanged(); |
81 | 81 |
82 void OnOverriddenDispatcherRestored(); | 82 void OnOverriddenDispatcherRestored(); |
83 | 83 |
84 // Use an ObserverList<> instead of an std::vector<> to store the list of | 84 // Use an base::ObserverList<> instead of an std::vector<> to store the list |
| 85 // of |
85 // dispatchers, so that adding/removing dispatchers during an event dispatch | 86 // dispatchers, so that adding/removing dispatchers during an event dispatch |
86 // is well-defined. | 87 // is well-defined. |
87 typedef ObserverList<PlatformEventDispatcher> PlatformEventDispatcherList; | 88 typedef base::ObserverList<PlatformEventDispatcher> |
| 89 PlatformEventDispatcherList; |
88 PlatformEventDispatcherList dispatchers_; | 90 PlatformEventDispatcherList dispatchers_; |
89 PlatformEventDispatcher* overridden_dispatcher_; | 91 PlatformEventDispatcher* overridden_dispatcher_; |
90 | 92 |
91 // Used to keep track of whether the current override-dispatcher has been | 93 // Used to keep track of whether the current override-dispatcher has been |
92 // reset and a previous override-dispatcher has been restored. | 94 // reset and a previous override-dispatcher has been restored. |
93 bool overridden_dispatcher_restored_; | 95 bool overridden_dispatcher_restored_; |
94 | 96 |
95 ObserverList<PlatformEventObserver> observers_; | 97 base::ObserverList<PlatformEventObserver> observers_; |
96 | 98 |
97 DISALLOW_COPY_AND_ASSIGN(PlatformEventSource); | 99 DISALLOW_COPY_AND_ASSIGN(PlatformEventSource); |
98 }; | 100 }; |
99 | 101 |
100 } // namespace ui | 102 } // namespace ui |
101 | 103 |
102 #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ | 104 #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ |
OLD | NEW |