OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_EVENTS_EVENT_TARGET_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_TARGET_H_ |
6 #define UI_BASE_EVENTS_EVENT_TARGET_H_ | 6 #define UI_BASE_EVENTS_EVENT_TARGET_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/base/events/event_handler.h" | 10 #include "ui/base/events/event_handler.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 protected: | 69 protected: |
70 void set_target_handler(EventHandler* handler) { | 70 void set_target_handler(EventHandler* handler) { |
71 target_handler_ = handler; | 71 target_handler_ = handler; |
72 } | 72 } |
73 | 73 |
74 // Overridden from EventHandler: | 74 // Overridden from EventHandler: |
75 virtual EventResult OnKeyEvent(KeyEvent* event) OVERRIDE; | 75 virtual EventResult OnKeyEvent(KeyEvent* event) OVERRIDE; |
76 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE; | 76 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE; |
77 virtual EventResult OnScrollEvent(ScrollEvent* event) OVERRIDE; | 77 virtual EventResult OnScrollEvent(ScrollEvent* event) OVERRIDE; |
78 virtual EventResult OnTouchEvent(TouchEvent* event) OVERRIDE; | 78 virtual EventResult OnTouchEvent(TouchEvent* event) OVERRIDE; |
79 virtual EventResult OnGestureEvent(GestureEvent* event) OVERRIDE; | 79 virtual void OnGestureEvent(GestureEvent* event) OVERRIDE; |
80 | 80 |
81 private: | 81 private: |
82 friend class EventDispatcher; | 82 friend class EventDispatcher; |
83 | 83 |
84 // Returns the list of handlers that should receive the event before the | 84 // Returns the list of handlers that should receive the event before the |
85 // target. The handlers from the outermost target are first in the list, and | 85 // target. The handlers from the outermost target are first in the list, and |
86 // the handlers on |this| are the last in the list. | 86 // the handlers on |this| are the last in the list. |
87 void GetPreTargetHandlers(EventHandlerList* list); | 87 void GetPreTargetHandlers(EventHandlerList* list); |
88 | 88 |
89 // Returns the list of handlers that should receive the event after the | 89 // Returns the list of handlers that should receive the event after the |
90 // target. The handlers from the outermost target are last in the list, and | 90 // target. The handlers from the outermost target are last in the list, and |
91 // the handlers on |this| are the first in the list. | 91 // the handlers on |this| are the first in the list. |
92 void GetPostTargetHandlers(EventHandlerList* list); | 92 void GetPostTargetHandlers(EventHandlerList* list); |
93 | 93 |
94 EventHandlerList pre_target_list_; | 94 EventHandlerList pre_target_list_; |
95 EventHandlerList post_target_list_; | 95 EventHandlerList post_target_list_; |
96 EventHandler* target_handler_; | 96 EventHandler* target_handler_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(EventTarget); | 98 DISALLOW_COPY_AND_ASSIGN(EventTarget); |
99 }; | 99 }; |
100 | 100 |
101 } // namespace ui | 101 } // namespace ui |
102 | 102 |
103 #endif // UI_BASE_EVENTS_EVENT_TARGET_H_ | 103 #endif // UI_BASE_EVENTS_EVENT_TARGET_H_ |
OLD | NEW |