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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2813103003: VR: Stop mouse move events when scrolling/fling (Closed)
Patch Set: Created 3 years, 8 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 | « content/browser/renderer_host/render_widget_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 09711bf99e6a98104138484b83ef52f995615260..b340350c3b2276fe58b11c1c1cb97f4d4e404c83 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -282,6 +282,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
has_touch_handler_(false),
is_in_touchpad_gesture_scroll_(false),
is_in_touchscreen_gesture_scroll_(false),
+ is_in_touchpad_gesture_fling_(false),
latency_tracker_(),
next_browser_snapshot_id_(1),
owned_by_render_frame_host_(false),
@@ -1018,6 +1019,11 @@ void RenderWidgetHostImpl::StartNewContentRenderingTimeout(
}
void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) {
+ if (GetView()->IsInVR() &&
dtapuska 2017/04/13 14:48:25 Can we put a comment here indicating why we are do
asimjour1 2017/04/13 16:31:35 Done.
+ (is_in_touchpad_gesture_scroll_ || is_in_touchpad_gesture_fling_)) {
+ return;
+ }
+
ForwardMouseEventWithLatencyInfo(mouse_event,
ui::LatencyInfo(ui::SourceEventType::OTHER));
if (owner_delegate_)
@@ -1111,6 +1117,8 @@ void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo(
// gesture_event.sourceDevice ==
// blink::WebGestureDevice::WebGestureDeviceTouchpad));
*is_in_gesture_scroll = false;
+ if (gesture_event.type() == blink::WebInputEvent::GestureFlingStart)
dtapuska 2017/04/13 14:48:25 I think this needs a check that the source device
asimjour1 2017/04/13 16:31:35 Done.
+ is_in_touchpad_gesture_fling_ = true;
}
bool scroll_update_needs_wrapping =
@@ -2219,6 +2227,7 @@ void RenderWidgetHostImpl::DidOverscroll(
}
void RenderWidgetHostImpl::DidStopFlinging() {
+ is_in_touchpad_gesture_fling_ = false;
if (view_)
view_->DidStopFlinging();
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698