Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| index 32bfe0a1f7bd6404309540f6d3822ce589191ca1..bcc01a642945e63c904b64d838dbec8645db202e 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -2190,6 +2190,19 @@ WebInputEventResult WebViewImpl::HandleInputEvent( |
| if (is_pointer_locked && |
| WebInputEvent::IsMouseEventType(input_event.GetType())) { |
| + LocalFrame* focusedFrame = FocusedLocalFrameInWidget(); |
| + if (focusedFrame) { |
| + WebMouseEvent transformed_event = TransformWebMouseEvent( |
| + MainFrameImpl()->GetFrameView(), |
| + static_cast<const WebMouseEvent&>(input_event)); |
| + Vector<WebMouseEvent> transformed_coalesced_events = |
| + TransformWebMouseEventVector( |
| + MainFrameImpl()->GetFrameView(), |
| + coalesced_event.GetCoalescedEventsPointers()); |
| + focusedFrame->GetEventHandler().ProcessPendingPointerCapture( |
| + transformed_event, transformed_coalesced_events); |
| + } |
| + |
| MainFrameImpl()->FrameWidget()->PointerLockMouseEvent(input_event); |
|
mustaq
2017/05/19 20:05:33
I believe we need a similar fix before another dir
lanwei
2017/05/23 23:11:42
You are right, I moved the code to the WebFrameWid
|
| return WebInputEventResult::kHandledSystem; |
| } |
| @@ -2559,6 +2572,10 @@ void WebViewImpl::WillCloseLayerTreeView() { |
| void WebViewImpl::DidAcquirePointerLock() { |
| if (MainFrameImpl()) |
| MainFrameImpl()->FrameWidget()->DidAcquirePointerLock(); |
| + |
| + LocalFrame* focusedFrame = FocusedLocalFrameInWidget(); |
| + if (focusedFrame) |
| + focusedFrame->GetEventHandler().ReleaseMousePointerCapture(); |
| } |
| void WebViewImpl::DidNotAcquirePointerLock() { |