OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 switch (event.type) { | 139 switch (event.type) { |
140 // FIXME: WebKit seems to always return false on mouse events processing | 140 // FIXME: WebKit seems to always return false on mouse events processing |
141 // methods. For now we'll assume it has processed them (as we are only | 141 // methods. For now we'll assume it has processed them (as we are only |
142 // interested in whether keyboard events are processed). | 142 // interested in whether keyboard events are processed). |
143 // FIXME: Why do we return HandleSuppressed when there is no root or | 143 // FIXME: Why do we return HandleSuppressed when there is no root or |
144 // the root is detached? | 144 // the root is detached? |
145 case WebInputEvent::MouseMove: | 145 case WebInputEvent::MouseMove: |
146 if (!root || !root->view()) | 146 if (!root || !root->view()) |
147 return WebInputEventResult::HandledSuppressed; | 147 return WebInputEventResult::HandledSuppressed; |
148 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event)); | 148 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event), |
| 149 std::vector<const WebInputEvent*>()); |
149 return WebInputEventResult::HandledSystem; | 150 return WebInputEventResult::HandledSystem; |
150 case WebInputEvent::MouseLeave: | 151 case WebInputEvent::MouseLeave: |
151 if (!root || !root->view()) | 152 if (!root || !root->view()) |
152 return WebInputEventResult::HandledSuppressed; | 153 return WebInputEventResult::HandledSuppressed; |
153 handler.handleMouseLeave(*root, static_cast<const WebMouseEvent&>(event)); | 154 handler.handleMouseLeave(*root, static_cast<const WebMouseEvent&>(event)); |
154 return WebInputEventResult::HandledSystem; | 155 return WebInputEventResult::HandledSystem; |
155 case WebInputEvent::MouseDown: | 156 case WebInputEvent::MouseDown: |
156 if (!root || !root->view()) | 157 if (!root || !root->view()) |
157 return WebInputEventResult::HandledSuppressed; | 158 return WebInputEventResult::HandledSuppressed; |
158 handler.handleMouseDown(*root, static_cast<const WebMouseEvent&>(event)); | 159 handler.handleMouseDown(*root, static_cast<const WebMouseEvent&>(event)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 static_cast<const WebGestureEvent&>(event)); | 196 static_cast<const WebGestureEvent&>(event)); |
196 | 197 |
197 case WebInputEvent::TouchStart: | 198 case WebInputEvent::TouchStart: |
198 case WebInputEvent::TouchMove: | 199 case WebInputEvent::TouchMove: |
199 case WebInputEvent::TouchEnd: | 200 case WebInputEvent::TouchEnd: |
200 case WebInputEvent::TouchCancel: | 201 case WebInputEvent::TouchCancel: |
201 case WebInputEvent::TouchScrollStarted: | 202 case WebInputEvent::TouchScrollStarted: |
202 if (!root || !root->view()) | 203 if (!root || !root->view()) |
203 return WebInputEventResult::NotHandled; | 204 return WebInputEventResult::NotHandled; |
204 return handler.handleTouchEvent(*root, | 205 return handler.handleTouchEvent(*root, |
205 static_cast<const WebTouchEvent&>(event)); | 206 static_cast<const WebTouchEvent&>(event), |
| 207 std::vector<const WebInputEvent*>()); |
206 case WebInputEvent::GesturePinchBegin: | 208 case WebInputEvent::GesturePinchBegin: |
207 case WebInputEvent::GesturePinchEnd: | 209 case WebInputEvent::GesturePinchEnd: |
208 case WebInputEvent::GesturePinchUpdate: | 210 case WebInputEvent::GesturePinchUpdate: |
209 // Touchscreen pinch events are currently not handled in main thread. | 211 // Touchscreen pinch events are currently not handled in main thread. |
210 // Once they are, these should be passed to |handleGestureEvent| similar | 212 // Once they are, these should be passed to |handleGestureEvent| similar |
211 // to gesture scroll events. | 213 // to gesture scroll events. |
212 return WebInputEventResult::NotHandled; | 214 return WebInputEventResult::NotHandled; |
213 default: | 215 default: |
214 return WebInputEventResult::NotHandled; | 216 return WebInputEventResult::NotHandled; |
215 } | 217 } |
216 } | 218 } |
217 | 219 |
218 // ---------------------------------------------------------------- | 220 // ---------------------------------------------------------------- |
219 // Default handlers for PageWidgetEventHandler | 221 // Default handlers for PageWidgetEventHandler |
220 | 222 |
221 void PageWidgetEventHandler::handleMouseMove(LocalFrame& mainFrame, | 223 void PageWidgetEventHandler::handleMouseMove( |
222 const WebMouseEvent& event) { | 224 LocalFrame& mainFrame, |
| 225 const WebMouseEvent& event, |
| 226 const std::vector<const WebInputEvent*>& coalescedEvents) { |
223 mainFrame.eventHandler().handleMouseMoveEvent( | 227 mainFrame.eventHandler().handleMouseMoveEvent( |
224 PlatformMouseEventBuilder(mainFrame.view(), event)); | 228 PlatformMouseEventBuilder(mainFrame.view(), event), |
| 229 createPlatformMouseEventVector(mainFrame.view(), coalescedEvents)); |
225 } | 230 } |
226 | 231 |
227 void PageWidgetEventHandler::handleMouseLeave(LocalFrame& mainFrame, | 232 void PageWidgetEventHandler::handleMouseLeave(LocalFrame& mainFrame, |
228 const WebMouseEvent& event) { | 233 const WebMouseEvent& event) { |
229 mainFrame.eventHandler().handleMouseLeaveEvent( | 234 mainFrame.eventHandler().handleMouseLeaveEvent( |
230 PlatformMouseEventBuilder(mainFrame.view(), event)); | 235 PlatformMouseEventBuilder(mainFrame.view(), event)); |
231 } | 236 } |
232 | 237 |
233 void PageWidgetEventHandler::handleMouseDown(LocalFrame& mainFrame, | 238 void PageWidgetEventHandler::handleMouseDown(LocalFrame& mainFrame, |
234 const WebMouseEvent& event) { | 239 const WebMouseEvent& event) { |
235 mainFrame.eventHandler().handleMousePressEvent( | 240 mainFrame.eventHandler().handleMousePressEvent( |
236 PlatformMouseEventBuilder(mainFrame.view(), event)); | 241 PlatformMouseEventBuilder(mainFrame.view(), event)); |
237 } | 242 } |
238 | 243 |
239 void PageWidgetEventHandler::handleMouseUp(LocalFrame& mainFrame, | 244 void PageWidgetEventHandler::handleMouseUp(LocalFrame& mainFrame, |
240 const WebMouseEvent& event) { | 245 const WebMouseEvent& event) { |
241 mainFrame.eventHandler().handleMouseReleaseEvent( | 246 mainFrame.eventHandler().handleMouseReleaseEvent( |
242 PlatformMouseEventBuilder(mainFrame.view(), event)); | 247 PlatformMouseEventBuilder(mainFrame.view(), event)); |
243 } | 248 } |
244 | 249 |
245 WebInputEventResult PageWidgetEventHandler::handleMouseWheel( | 250 WebInputEventResult PageWidgetEventHandler::handleMouseWheel( |
246 LocalFrame& mainFrame, | 251 LocalFrame& mainFrame, |
247 const WebMouseWheelEvent& event) { | 252 const WebMouseWheelEvent& event) { |
248 return mainFrame.eventHandler().handleWheelEvent( | 253 return mainFrame.eventHandler().handleWheelEvent( |
249 PlatformWheelEventBuilder(mainFrame.view(), event)); | 254 PlatformWheelEventBuilder(mainFrame.view(), event)); |
250 } | 255 } |
251 | 256 |
252 WebInputEventResult PageWidgetEventHandler::handleTouchEvent( | 257 WebInputEventResult PageWidgetEventHandler::handleTouchEvent( |
253 LocalFrame& mainFrame, | 258 LocalFrame& mainFrame, |
254 const WebTouchEvent& event) { | 259 const WebTouchEvent& event, |
| 260 const std::vector<const WebInputEvent*>& coalescedEvents) { |
255 return mainFrame.eventHandler().handleTouchEvent( | 261 return mainFrame.eventHandler().handleTouchEvent( |
256 PlatformTouchEventBuilder(mainFrame.view(), event)); | 262 PlatformTouchEventBuilder(mainFrame.view(), event), |
| 263 createPlatformTouchEventVector(mainFrame.view(), coalescedEvents)); |
257 } | 264 } |
258 | 265 |
259 } // namespace blink | 266 } // namespace blink |
OLD | NEW |