Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
| index 7802cd487bbc30deeef86de85c1bef7fb4cb9b58..04138dd602db31c35c883e04d8729e8f55785fc4 100644 |
| --- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
| @@ -710,6 +710,8 @@ void WebPluginContainerImpl::HandleMouseEvent(MouseEvent* event) { |
| // in the call to HandleEvent. See http://b/issue?id=1362948 |
| FrameView* parent_view = ToFrameView(Parent()); |
| + // TODO(dtapuska): Move WebMouseEventBuilder into the anonymous namespace |
| + // in this class. |
| WebMouseEventBuilder transformed_event( |
| ToFrameView(Parent()), LayoutItem(element_->GetLayoutObject()), *event); |
| if (transformed_event.GetType() == WebInputEvent::kUndefined) |
| @@ -767,6 +769,14 @@ void WebPluginContainerImpl::HandleDragEvent(MouseEvent* event) { |
| void WebPluginContainerImpl::HandleWheelEvent(WheelEvent* event) { |
| WebFloatPoint absolute_root_frame_location = |
|
bokan
2017/04/12 17:28:44
This (and below) should now be called absolute_loc
dtapuska
2017/04/12 19:02:56
Done.
|
| event->NativeEvent().PositionInRootFrame(); |
| + |
| + FrameView* view = ToFrameView(Parent()); |
| + // Translate the root frame position to content coordinates. |
| + if (view) { |
| + absolute_root_frame_location = |
| + view->RootFrameToContents(absolute_root_frame_location); |
| + } |
| + |
| IntPoint local_point = |
| RoundedIntPoint(element_->GetLayoutObject()->AbsoluteToLocal( |
| absolute_root_frame_location, kUseTransforms)); |
| @@ -830,9 +840,18 @@ void WebPluginContainerImpl::HandleTouchEvent(TouchEvent* event) { |
| WebTouchEvent transformed_event = |
| event->NativeEvent()->FlattenTransform(); |
| + FrameView* view = ToFrameView(Parent()); |
| + |
| for (unsigned i = 0; i < transformed_event.touches_length; ++i) { |
| WebFloatPoint absolute_root_frame_location = |
| transformed_event.touches[i].position; |
| + |
| + // Translate the root frame position to content coordinates. |
| + if (view) { |
| + absolute_root_frame_location = |
| + view->RootFrameToContents(absolute_root_frame_location); |
| + } |
| + |
| IntPoint local_point = |
| RoundedIntPoint(element_->GetLayoutObject()->AbsoluteToLocal( |
| absolute_root_frame_location, kUseTransforms)); |