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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 535313002: Indicate user gesture for mouse down/up while pointer locked. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index a95346118a8a53bb327cf1173dcb3b3895635900..def35ad627ea8183b567e1c9adb609fba1fc450e 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2551,6 +2551,7 @@ void WebViewImpl::didNotAcquirePointerLock()
void WebViewImpl::didLosePointerLock()
{
+ m_pointerLockGestureToken.clear();
if (page())
page()->pointerLockController().didLosePointerLock();
}
@@ -4232,13 +4233,17 @@ bool WebViewImpl::isPointerLocked()
void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event)
{
+ OwnPtr<UserGestureIndicator> gestureIndicator;
AtomicString eventType;
switch (event.type) {
case WebInputEvent::MouseDown:
eventType = EventTypeNames::mousedown;
+ gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
+ m_pointerLockGestureToken = gestureIndicator->currentToken();
break;
case WebInputEvent::MouseUp:
eventType = EventTypeNames::mouseup;
+ gestureIndicator = adoptPtr(new UserGestureIndicator(m_pointerLockGestureToken.release()));
break;
case WebInputEvent::MouseMove:
eventType = EventTypeNames::mousemove;
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698