Chromium Code Reviews| 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 56926a544c3a5efb2f171145e992573467118280..185a710989f8f25d20db1471fb4b9f74c277d7ce 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" |
| @@ -661,6 +662,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* |
| + // fling that requires both animation and a fling-end notification. |
| + // However, the here we've just indicated touchpad scroll has ended, and |
|
wjmaclean
2016/07/22 00:42:01
I'll remove the redundant 'the' before landing.
|
| + // we're not going to actually tick a fling animation. Report no consumer |
| + // 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) { |