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

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index 563b887b646c9370f9aba384aa65aeb8a22820a5..b015b9b24c3c74bcf88b809e27ac3f92d7c83155 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -372,11 +372,11 @@ WebInputEventResult WebFrameWidgetImpl::handleInputEvent(
NOTREACHED();
}
- node->dispatchMouseEvent(
- PlatformMouseEventBuilder(
- m_localRoot->frameView(),
- static_cast<const WebMouseEvent&>(inputEvent)),
- eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount);
+ WebMouseEvent transformedEvent =
+ TransformWebMouseEvent(m_localRoot->frameView(),
+ static_cast<const WebMouseEvent&>(inputEvent));
+ node->dispatchMouseEvent(transformedEvent, eventType,
+ transformedEvent.clickCount);
return WebInputEventResult::HandledSystem;
}
@@ -776,10 +776,13 @@ void WebFrameWidgetImpl::handleMouseDown(LocalFrame& mainFrame,
void WebFrameWidgetImpl::mouseContextMenu(const WebMouseEvent& event) {
page()->contextMenuController().clearContextMenu();
- PlatformMouseEventBuilder pme(m_localRoot->frameView(), event);
+ WebMouseEvent transformedEvent =
+ TransformWebMouseEvent(m_localRoot->frameView(), event);
+ IntPoint positionInRootFrame =
+ flooredIntPoint(transformedEvent.positionInRootFrame());
// Find the right target frame. See issue 1186900.
- HitTestResult result = hitTestResultForRootFramePos(pme.position());
+ HitTestResult result = hitTestResultForRootFramePos(positionInRootFrame);
Frame* targetFrame;
if (result.innerNodeOrImageMapImage())
targetFrame = result.innerNodeOrImageMapImage()->document().frame();
@@ -801,7 +804,8 @@ void WebFrameWidgetImpl::mouseContextMenu(const WebMouseEvent& event) {
{
ContextMenuAllowedScope scope;
- targetLocalFrame->eventHandler().sendContextMenuEvent(pme, nullptr);
+ targetLocalFrame->eventHandler().sendContextMenuEvent(transformedEvent,
+ nullptr);
}
// Actually showing the context menu is handled by the ContextMenuClient
// implementation...

Powered by Google App Engine
This is Rietveld 408576698