Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: third_party/WebKit/Source/web/PageWidgetDelegate.cpp

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers); 112 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers);
113 } 113 }
114 114
115 WebInputEventResult PageWidgetDelegate::handleInputEvent( 115 WebInputEventResult PageWidgetDelegate::handleInputEvent(
116 PageWidgetEventHandler& handler, 116 PageWidgetEventHandler& handler,
117 const WebCoalescedInputEvent& coalescedEvent, 117 const WebCoalescedInputEvent& coalescedEvent,
118 LocalFrame* root) { 118 LocalFrame* root) {
119 const WebInputEvent& event = coalescedEvent.event(); 119 const WebInputEvent& event = coalescedEvent.event();
120 if (event.modifiers() & WebInputEvent::IsTouchAccessibility && 120 if (event.modifiers() & WebInputEvent::IsTouchAccessibility &&
121 WebInputEvent::isMouseEventType(event.type())) { 121 WebInputEvent::isMouseEventType(event.type())) {
122 PlatformMouseEventBuilder pme(root->view(), 122 WebMouseEvent mouseEvent = TransformWebMouseEvent(
123 static_cast<const WebMouseEvent&>(event)); 123 root->view(), static_cast<const WebMouseEvent&>(event));
124 124
125 IntPoint docPoint(root->view()->rootFrameToContents(pme.position())); 125 IntPoint docPoint(root->view()->rootFrameToContents(
126 flooredIntPoint(mouseEvent.positionInRootFrame())));
126 HitTestResult result = root->eventHandler().hitTestResultAtPoint( 127 HitTestResult result = root->eventHandler().hitTestResultAtPoint(
127 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); 128 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
128 result.setToShadowHostIfInUserAgentShadowRoot(); 129 result.setToShadowHostIfInUserAgentShadowRoot();
129 if (result.innerNodeFrame()) { 130 if (result.innerNodeFrame()) {
130 Document* document = result.innerNodeFrame()->document(); 131 Document* document = result.innerNodeFrame()->document();
131 if (document) { 132 if (document) {
132 AXObjectCache* cache = document->existingAXObjectCache(); 133 AXObjectCache* cache = document->existingAXObjectCache();
133 if (cache) 134 if (cache)
134 cache->onTouchAccessibilityHover( 135 cache->onTouchAccessibilityHover(
135 result.roundedPointInInnerNodeFrame()); 136 result.roundedPointInInnerNodeFrame());
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 219 }
219 } 220 }
220 221
221 // ---------------------------------------------------------------- 222 // ----------------------------------------------------------------
222 // Default handlers for PageWidgetEventHandler 223 // Default handlers for PageWidgetEventHandler
223 224
224 void PageWidgetEventHandler::handleMouseMove( 225 void PageWidgetEventHandler::handleMouseMove(
225 LocalFrame& mainFrame, 226 LocalFrame& mainFrame,
226 const WebMouseEvent& event, 227 const WebMouseEvent& event,
227 const std::vector<const WebInputEvent*>& coalescedEvents) { 228 const std::vector<const WebInputEvent*>& coalescedEvents) {
229 WebMouseEvent transformedEvent =
230 TransformWebMouseEvent(mainFrame.view(), event);
228 mainFrame.eventHandler().handleMouseMoveEvent( 231 mainFrame.eventHandler().handleMouseMoveEvent(
229 PlatformMouseEventBuilder(mainFrame.view(), event), 232 transformedEvent,
230 createPlatformMouseEventVector(mainFrame.view(), coalescedEvents)); 233 TransformWebMouseEventVector(mainFrame.view(), coalescedEvents));
231 } 234 }
232 235
233 void PageWidgetEventHandler::handleMouseLeave(LocalFrame& mainFrame, 236 void PageWidgetEventHandler::handleMouseLeave(LocalFrame& mainFrame,
234 const WebMouseEvent& event) { 237 const WebMouseEvent& event) {
235 mainFrame.eventHandler().handleMouseLeaveEvent( 238 WebMouseEvent transformedEvent =
236 PlatformMouseEventBuilder(mainFrame.view(), event)); 239 TransformWebMouseEvent(mainFrame.view(), event);
240 mainFrame.eventHandler().handleMouseLeaveEvent(transformedEvent);
237 } 241 }
238 242
239 void PageWidgetEventHandler::handleMouseDown(LocalFrame& mainFrame, 243 void PageWidgetEventHandler::handleMouseDown(LocalFrame& mainFrame,
240 const WebMouseEvent& event) { 244 const WebMouseEvent& event) {
241 mainFrame.eventHandler().handleMousePressEvent( 245 WebMouseEvent transformedEvent =
242 PlatformMouseEventBuilder(mainFrame.view(), event)); 246 TransformWebMouseEvent(mainFrame.view(), event);
247 mainFrame.eventHandler().handleMousePressEvent(transformedEvent);
243 } 248 }
244 249
245 void PageWidgetEventHandler::handleMouseUp(LocalFrame& mainFrame, 250 void PageWidgetEventHandler::handleMouseUp(LocalFrame& mainFrame,
246 const WebMouseEvent& event) { 251 const WebMouseEvent& event) {
247 mainFrame.eventHandler().handleMouseReleaseEvent( 252 WebMouseEvent transformedEvent =
248 PlatformMouseEventBuilder(mainFrame.view(), event)); 253 TransformWebMouseEvent(mainFrame.view(), event);
254 mainFrame.eventHandler().handleMouseReleaseEvent(transformedEvent);
249 } 255 }
250 256
251 WebInputEventResult PageWidgetEventHandler::handleMouseWheel( 257 WebInputEventResult PageWidgetEventHandler::handleMouseWheel(
252 LocalFrame& mainFrame, 258 LocalFrame& mainFrame,
253 const WebMouseWheelEvent& event) { 259 const WebMouseWheelEvent& event) {
254 WebMouseWheelEvent transformedEvent = 260 WebMouseWheelEvent transformedEvent =
255 TransformWebMouseWheelEvent(mainFrame.view(), event); 261 TransformWebMouseWheelEvent(mainFrame.view(), event);
256 return mainFrame.eventHandler().handleWheelEvent(transformedEvent); 262 return mainFrame.eventHandler().handleWheelEvent(transformedEvent);
257 } 263 }
258 264
259 WebInputEventResult PageWidgetEventHandler::handleTouchEvent( 265 WebInputEventResult PageWidgetEventHandler::handleTouchEvent(
260 LocalFrame& mainFrame, 266 LocalFrame& mainFrame,
261 const WebTouchEvent& event, 267 const WebTouchEvent& event,
262 const std::vector<const WebInputEvent*>& coalescedEvents) { 268 const std::vector<const WebInputEvent*>& coalescedEvents) {
263 WebTouchEvent transformedEvent = 269 WebTouchEvent transformedEvent =
264 TransformWebTouchEvent(mainFrame.view(), event); 270 TransformWebTouchEvent(mainFrame.view(), event);
265 return mainFrame.eventHandler().handleTouchEvent( 271 return mainFrame.eventHandler().handleTouchEvent(
266 transformedEvent, 272 transformedEvent,
267 TransformWebTouchEventVector(mainFrame.view(), coalescedEvents)); 273 TransformWebTouchEventVector(mainFrame.view(), coalescedEvents));
268 } 274 }
269 275
270 } // namespace blink 276 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698