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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandlingUtil.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "core/input/EventHandlingUtil.h" 5 #include "core/input/EventHandlingUtil.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/layout/api/LayoutViewItem.h" 9 #include "core/layout/api/LayoutViewItem.h"
10 #include "core/paint/PaintLayer.h" 10 #include "core/paint/PaintLayer.h"
11 #include "platform/scroll/ScrollableArea.h" 11 #include "platform/scroll/ScrollableArea.h"
12 #include "public/platform/WebMouseEvent.h"
12 13
13 namespace blink { 14 namespace blink {
14 namespace EventHandlingUtil { 15 namespace EventHandlingUtil {
15 16
16 HitTestResult hitTestResultInFrame(LocalFrame* frame, 17 HitTestResult hitTestResultInFrame(LocalFrame* frame,
17 const LayoutPoint& point, 18 const LayoutPoint& point,
18 HitTestRequest::HitTestRequestType hitType) { 19 HitTestRequest::HitTestRequestType hitType) {
19 HitTestResult result(HitTestRequest(hitType), point); 20 HitTestResult result(HitTestRequest(hitType), point);
20 21
21 if (!frame || frame->contentLayoutItem().isNull()) 22 if (!frame || frame->contentLayoutItem().isNull())
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 const IntPoint& pointInRootFrame) { 104 const IntPoint& pointInRootFrame) {
104 FrameView* view = frame->view(); 105 FrameView* view = frame->view();
105 // FIXME: Is it really OK to use the wrong coordinates here when view is 0? 106 // FIXME: Is it really OK to use the wrong coordinates here when view is 0?
106 // Historically the code would just crash; this is clearly no worse than that. 107 // Historically the code would just crash; this is clearly no worse than that.
107 return view ? view->rootFrameToContents(pointInRootFrame) : pointInRootFrame; 108 return view ? view->rootFrameToContents(pointInRootFrame) : pointInRootFrame;
108 } 109 }
109 110
110 MouseEventWithHitTestResults performMouseEventHitTest( 111 MouseEventWithHitTestResults performMouseEventHitTest(
111 LocalFrame* frame, 112 LocalFrame* frame,
112 const HitTestRequest& request, 113 const HitTestRequest& request,
113 const PlatformMouseEvent& mev) { 114 const WebMouseEvent& mev) {
114 DCHECK(frame); 115 DCHECK(frame);
115 DCHECK(frame->document()); 116 DCHECK(frame->document());
116 117
117 return frame->document()->performMouseEventHitTest( 118 return frame->document()->performMouseEventHitTest(
118 request, contentPointFromRootFrame(frame, mev.position()), mev); 119 request, contentPointFromRootFrame(
120 frame, flooredIntPoint(mev.positionInRootFrame())),
121 mev);
119 } 122 }
120 123
121 } // namespace EventHandlingUtil 124 } // namespace EventHandlingUtil
122 } // namespace blink 125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698