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 UI_EVENTS_EVENT_SOURCE_H_ | 5 #ifndef UI_EVENTS_EVENT_SOURCE_H_ |
6 #define UI_EVENTS_EVENT_SOURCE_H_ | 6 #define UI_EVENTS_EVENT_SOURCE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/events/event_dispatcher.h" | 10 #include "ui/events/event_dispatcher.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Adds a rewriter to modify events before they are sent to the | 28 // Adds a rewriter to modify events before they are sent to the |
29 // EventProcessor. The rewriter must be explicitly removed from the | 29 // EventProcessor. The rewriter must be explicitly removed from the |
30 // EventSource before the rewriter is destroyed. The EventSource | 30 // EventSource before the rewriter is destroyed. The EventSource |
31 // does not take ownership of the rewriter. | 31 // does not take ownership of the rewriter. |
32 void AddEventRewriter(EventRewriter* rewriter); | 32 void AddEventRewriter(EventRewriter* rewriter); |
33 void RemoveEventRewriter(EventRewriter* rewriter); | 33 void RemoveEventRewriter(EventRewriter* rewriter); |
34 | 34 |
35 protected: | 35 protected: |
36 EventDispatchDetails SendEventToProcessor(Event* event); | 36 EventDispatchDetails SendEventToProcessor(Event* event); |
37 virtual EventDispatchDetails DeliverEventToProcessor(Event* event); | |
38 | 37 |
39 private: | 38 private: |
40 friend class EventSourceTestApi; | 39 friend class EventSourceTestApi; |
41 | 40 |
| 41 EventDispatchDetails DeliverEventToProcessor(Event* event); |
| 42 |
42 typedef std::vector<EventRewriter*> EventRewriterList; | 43 typedef std::vector<EventRewriter*> EventRewriterList; |
43 EventRewriterList rewriter_list_; | 44 EventRewriterList rewriter_list_; |
44 DISALLOW_COPY_AND_ASSIGN(EventSource); | 45 DISALLOW_COPY_AND_ASSIGN(EventSource); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace ui | 48 } // namespace ui |
48 | 49 |
49 #endif // UI_EVENTS_EVENT_SOURCE_H_ | 50 #endif // UI_EVENTS_EVENT_SOURCE_H_ |
OLD | NEW |