diff options
Diffstat (limited to 'content/browser/renderer_host/overscroll_controller.cc')
-rw-r--r-- | content/browser/renderer_host/overscroll_controller.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc index 7e9ba4b..2babec8 100644 --- a/content/browser/renderer_host/overscroll_controller.cc +++ b/content/browser/renderer_host/overscroll_controller.cc @@ -4,6 +4,7 @@ #include "content/browser/renderer_host/overscroll_controller.h" +#include "content/browser/renderer_host/gesture_event_filter.h" #include "content/browser/renderer_host/overscroll_controller_delegate.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/public/browser/overscroll_configuration.h" @@ -62,12 +63,12 @@ bool OverscrollController::WillDispatchEvent( // touch-scrolls maintain state in the renderer side (in the compositor, for // example), and the event that completes this action needs to be sent to // the renderer so that those states can be updated/reset appropriately. - // Send the event through the host when appropriate. - if (ShouldForwardToHost(event)) { + // Send the event through the gesture-event filter when appropriate. + if (ShouldForwardToGestureFilter(event)) { const WebKit::WebGestureEvent& gevent = static_cast<const WebKit::WebGestureEvent&>(event); - return render_widget_host_->ShouldForwardGestureEvent( - GestureEventWithLatencyInfo(gevent, latency_info)); + return render_widget_host_->gesture_event_filter()-> + ShouldForward(GestureEventWithLatencyInfo(gevent, latency_info)); } return false; @@ -77,11 +78,12 @@ bool OverscrollController::WillDispatchEvent( SetOverscrollMode(OVERSCROLL_NONE); // The overscroll gesture status is being reset. If the event is a // gesture event (from either touchscreen or trackpad), then make sure the - // host gets the event first (if it didn't already process it). - if (ShouldForwardToHost(event)) { + // gesture event filter gets the event first (if it didn't already process + // it). + if (ShouldForwardToGestureFilter(event)) { const WebKit::WebGestureEvent& gevent = static_cast<const WebKit::WebGestureEvent&>(event); - return render_widget_host_->ShouldForwardGestureEvent( + return render_widget_host_->gesture_event_filter()->ShouldForward( GestureEventWithLatencyInfo(gevent, latency_info)); } @@ -360,14 +362,14 @@ void OverscrollController::SetOverscrollMode(OverscrollMode mode) { delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_); } -bool OverscrollController::ShouldForwardToHost( +bool OverscrollController::ShouldForwardToGestureFilter( const WebKit::WebInputEvent& event) const { if (!WebKit::WebInputEvent::isGestureEventType(event.type)) return false; - // If the RenderWidgetHost already processed this event, then the event must - // not be sent again. - return !render_widget_host_->HasQueuedGestureEvents(); + // If the GestureEventFilter already processed this event, then the event must + // not be sent to the filter again. + return !render_widget_host_->gesture_event_filter()->HasQueuedGestureEvents(); } } // namespace content |