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..0e87efe1df348dd8649c23cea6adafbaab22bb2b 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -2191,6 +2191,19 @@ WebInputEventResult WebViewImpl::HandleInputEvent( |
| if (is_pointer_locked && |
| WebInputEvent::IsMouseEventType(input_event.GetType())) { |
| MainFrameImpl()->FrameWidget()->PointerLockMouseEvent(input_event); |
| + 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().DispatchLostPointerCaptureEvent( |
|
Navid Zolghadr
2017/05/17 16:30:11
This doesn't seem correct. We should have called P
|
| + transformed_event, transformed_coalesced_events); |
| + } |
| return WebInputEventResult::kHandledSystem; |
| } |
| @@ -2279,6 +2292,11 @@ void WebViewImpl::SetCursorVisibilityState(bool is_visible) { |
| void WebViewImpl::MouseCaptureLost() { |
| TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this); |
| mouse_capture_node_ = nullptr; |
| + |
| + LocalFrame* focusedFrame = FocusedLocalFrameInWidget(); |
| + |
| + if (focusedFrame) |
| + focusedFrame->GetEventHandler().ReleaseMousePointerCapture(); |
|
Navid Zolghadr
2017/05/17 16:30:11
Why do we need to release mouse capture when captu
lanwei
2017/05/19 15:05:00
This is for the case that we call the setPointerCa
|
| } |
| void WebViewImpl::SetFocus(bool enable) { |