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 24 matching lines...) Expand all Loading... |
35 // event. | 35 // event. |
36 void AddPlatformEventDispatcher(PlatformEventDispatcher* dispatcher); | 36 void AddPlatformEventDispatcher(PlatformEventDispatcher* dispatcher); |
37 | 37 |
38 // Removes a dispatcher from the dispatcher list. Dispatchers can safely be | 38 // Removes a dispatcher from the dispatcher list. Dispatchers can safely be |
39 // removed from the dispatcher list during an event is being dispatched, | 39 // removed from the dispatcher list during an event is being dispatched, |
40 // without affecting the dispatch of the event to other existing dispatchers. | 40 // without affecting the dispatch of the event to other existing dispatchers. |
41 void RemovePlatformEventDispatcher(PlatformEventDispatcher* dispatcher); | 41 void RemovePlatformEventDispatcher(PlatformEventDispatcher* dispatcher); |
42 | 42 |
43 // Installs a PlatformEventDispatcher that receives all the events. The | 43 // Installs a PlatformEventDispatcher that receives all the events. The |
44 // dispatcher can process the event, or request that the default dispatchers | 44 // dispatcher can process the event, or request that the default dispatchers |
45 // be invoked by setting |POST_DISPATCH_PERFORM_DEFAULT| flag from the | 45 // be invoked by setting |kPostDispatchPerformDefault| flag from the |
46 // |DispatchEvent()| override. | 46 // |DispatchEvent()| override. |
47 // The returned |ScopedEventDispatcher| object is a handler for the overridden | 47 // The returned |ScopedEventDispatcher| object is a handler for the overridden |
48 // dispatcher. When this handler is destroyed, it removes the overridden | 48 // dispatcher. When this handler is destroyed, it removes the overridden |
49 // dispatcher, and restores the previous override-dispatcher (or NULL if there | 49 // dispatcher, and restores the previous override-dispatcher (or NULL if there |
50 // wasn't any). | 50 // wasn't any). |
51 scoped_ptr<ScopedEventDispatcher> OverrideDispatcher( | 51 scoped_ptr<ScopedEventDispatcher> OverrideDispatcher( |
52 PlatformEventDispatcher* dispatcher); | 52 PlatformEventDispatcher* dispatcher); |
53 | 53 |
54 void AddPlatformEventObserver(PlatformEventObserver* observer); | 54 void AddPlatformEventObserver(PlatformEventObserver* observer); |
55 void RemovePlatformEventObserver(PlatformEventObserver* observer); | 55 void RemovePlatformEventObserver(PlatformEventObserver* observer); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 bool overridden_dispatcher_restored_; | 93 bool overridden_dispatcher_restored_; |
94 | 94 |
95 ObserverList<PlatformEventObserver> observers_; | 95 ObserverList<PlatformEventObserver> observers_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(PlatformEventSource); | 97 DISALLOW_COPY_AND_ASSIGN(PlatformEventSource); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace ui | 100 } // namespace ui |
101 | 101 |
102 #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ | 102 #endif // UI_EVENTS_PLATFORM_PLATFORM_EVENT_SOURCE_H_ |
OLD | NEW |