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_EVENTS_EVENT_TARGET_H_ | 5 #ifndef UI_EVENTS_EVENT_TARGET_H_ |
6 #define UI_EVENTS_EVENT_TARGET_H_ | 6 #define UI_EVENTS_EVENT_TARGET_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 bool IsPreTargetListEmpty() const; | 78 bool IsPreTargetListEmpty() const; |
79 | 79 |
80 void set_target_handler(EventHandler* handler) { | 80 void set_target_handler(EventHandler* handler) { |
81 target_handler_ = handler; | 81 target_handler_ = handler; |
82 } | 82 } |
83 | 83 |
84 protected: | 84 protected: |
85 EventHandler* target_handler() { return target_handler_; } | 85 EventHandler* target_handler() { return target_handler_; } |
86 | 86 |
87 // Overridden from EventHandler: | 87 // Overridden from EventHandler: |
88 virtual void OnEvent(Event* event) OVERRIDE; | 88 virtual void OnEvent(Event* event) override; |
89 virtual void OnKeyEvent(KeyEvent* event) OVERRIDE; | 89 virtual void OnKeyEvent(KeyEvent* event) override; |
90 virtual void OnMouseEvent(MouseEvent* event) OVERRIDE; | 90 virtual void OnMouseEvent(MouseEvent* event) override; |
91 virtual void OnScrollEvent(ScrollEvent* event) OVERRIDE; | 91 virtual void OnScrollEvent(ScrollEvent* event) override; |
92 virtual void OnTouchEvent(TouchEvent* event) OVERRIDE; | 92 virtual void OnTouchEvent(TouchEvent* event) override; |
93 virtual void OnGestureEvent(GestureEvent* event) OVERRIDE; | 93 virtual void OnGestureEvent(GestureEvent* event) override; |
94 | 94 |
95 private: | 95 private: |
96 friend class EventDispatcher; | 96 friend class EventDispatcher; |
97 friend class EventTargetTestApi; | 97 friend class EventTargetTestApi; |
98 | 98 |
99 // Returns the list of handlers that should receive the event before the | 99 // Returns the list of handlers that should receive the event before the |
100 // target. The handlers from the outermost target are first in the list, and | 100 // target. The handlers from the outermost target are first in the list, and |
101 // the handlers on |this| are the last in the list. | 101 // the handlers on |this| are the last in the list. |
102 void GetPreTargetHandlers(EventHandlerList* list); | 102 void GetPreTargetHandlers(EventHandlerList* list); |
103 | 103 |
104 // Returns the list of handlers that should receive the event after the | 104 // Returns the list of handlers that should receive the event after the |
105 // target. The handlers from the outermost target are last in the list, and | 105 // target. The handlers from the outermost target are last in the list, and |
106 // the handlers on |this| are the first in the list. | 106 // the handlers on |this| are the first in the list. |
107 void GetPostTargetHandlers(EventHandlerList* list); | 107 void GetPostTargetHandlers(EventHandlerList* list); |
108 | 108 |
109 EventHandlerList pre_target_list_; | 109 EventHandlerList pre_target_list_; |
110 EventHandlerList post_target_list_; | 110 EventHandlerList post_target_list_; |
111 EventHandler* target_handler_; | 111 EventHandler* target_handler_; |
112 | 112 |
113 DISALLOW_COPY_AND_ASSIGN(EventTarget); | 113 DISALLOW_COPY_AND_ASSIGN(EventTarget); |
114 }; | 114 }; |
115 | 115 |
116 } // namespace ui | 116 } // namespace ui |
117 | 117 |
118 #endif // UI_EVENTS_EVENT_TARGET_H_ | 118 #endif // UI_EVENTS_EVENT_TARGET_H_ |
OLD | NEW |