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

Unified Diff: content/browser/frame_host/render_widget_host_view_child_frame.cc

Issue 2173603002: Filter GestureFlingStarts with Vx=Vy=0 in RenderWidgetHostViewChildFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment, undo unintended formatting change. Created 4 years, 5 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: content/browser/frame_host/render_widget_host_view_child_frame.cc
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
index 09f1353e453a7a173507f4aff28078083853de7d..7e7f8e6eea58ad06e0aa1f3c9d93c25806ff3340 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -33,6 +33,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/common/browser_plugin_guest_mode.h"
#include "gpu/ipc/common/gpu_messages.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/size_f.h"
@@ -655,6 +656,28 @@ void RenderWidgetHostViewChildFrame::OnSetNeedsBeginFrames(
}
}
+InputEventAckState RenderWidgetHostViewChildFrame::FilterInputEvent(
+ const blink::WebInputEvent& input_event) {
+ if (input_event.type == blink::WebInputEvent::GestureFlingStart) {
+ const blink::WebGestureEvent& gesture_event =
+ static_cast<const blink::WebGestureEvent&>(input_event);
+ // Zero-velocity touchpad flings are an Aura-specific signal that the
+ // touchpad scroll has ended, and should not be forwarded to the renderer.
+ if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad &&
+ !gesture_event.data.flingStart.velocityX &&
+ !gesture_event.data.flingStart.velocityY) {
+ // Reporting consumed for a fling suggests that there's now an *active*
Charlie Reis 2016/07/22 17:25:55 nit: Can you rephrase? I'm not sure what "Reporti
+ // fling that requires both animation and a fling-end notification.
+ // However, here we've just indicated touchpad scroll has ended, and
+ // we're not going to actually tick a fling animation. Report no consumer
Charlie Reis 2016/07/22 17:25:55 tick?
+ // to convey this.
+ return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
+ }
+ }
+
+ return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
+}
+
BrowserAccessibilityManager*
RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate, bool for_root_frame) {

Powered by Google App Engine
This is Rietveld 408576698