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

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

Issue 2696523003: Unify the code paths for handling mouse events when pointer is locked on (Closed)
Patch Set: remove null check 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 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 730243d4a00443a9ed5118dd2e46261e45c5a3f3..8fd20c1976d0acfa28484c9be18d3c7ef7ca7a75 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -337,6 +337,12 @@ WebInputEventResult WebFrameWidgetImpl::handleInputEvent(
AutoReset<const WebInputEvent*> currentEventChange(&m_currentInputEvent,
&inputEvent);
+ if (m_client->isPointerLocked() &&
+ WebInputEvent::isMouseEventType(inputEvent.type())) {
+ pointerLockMouseEvent(inputEvent);
+ return WebInputEventResult::HandledSystem;
+ }
+
if (m_mouseCaptureNode &&
WebInputEvent::isMouseEventType(inputEvent.type())) {
TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type());
@@ -667,18 +673,6 @@ void WebFrameWidgetImpl::willCloseLayerTreeView() {
m_layerTreeViewClosed = true;
}
-void WebFrameWidgetImpl::didAcquirePointerLock() {
- page()->pointerLockController().didAcquirePointerLock();
-}
-
-void WebFrameWidgetImpl::didNotAcquirePointerLock() {
- page()->pointerLockController().didNotAcquirePointerLock();
-}
-
-void WebFrameWidgetImpl::didLosePointerLock() {
- page()->pointerLockController().didLosePointerLock();
-}
-
// TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This
// code needs to be refactored (http://crbug.com/629721).
bool WebFrameWidgetImpl::getCompositionCharacterBounds(
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebViewFrameWidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698