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..8fbfdc163d3866366f5a4d5027a5b26eae854068 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,31 @@ 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) { |
+ // Here we indicate that there was no consumer for this event, as |
+ // otherwise the fling animation system will try to run an animation |
+ // and will also expect a notification when the fling ends. Since |
+ // CrOS just uses the GestureFlingStart with zero-velocity as a means |
+ // of indicating that touchpad scroll has ended, we don't actually want |
+ // a fling animation. |
+ // Note: this event handling is modeled on similar code in |
+ // TenderWidgetHostViewAura::FilterInputEvent(). |
+ return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
+ } |
+ } |
+ |
+ return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
+} |
+ |
BrowserAccessibilityManager* |
RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager( |
BrowserAccessibilityDelegate* delegate, bool for_root_frame) { |