Index: content/browser/renderer_host/render_widget_host_view_android.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
index c1aa70b52ef90ce1733e1576ad58885982f04060..14dd91313e3ea1581eb7956e9df6b71c64014b30 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
@@ -1101,23 +1101,25 @@ void RenderWidgetHostViewAndroid::UnhandledWheelEvent( |
} |
void RenderWidgetHostViewAndroid::GestureEventAck( |
- int gesture_event_type, |
+ const blink::WebGestureEvent& event, |
InputEventAckState ack_result) { |
- // Scroll events. |
- if (gesture_event_type == blink::WebInputEvent::GestureScrollBegin) { |
+ if (event.type == blink::WebInputEvent::GestureScrollBegin) { |
content_view_core_->OnScrollBeginEventAck(); |
- } |
- if (gesture_event_type == blink::WebInputEvent::GestureScrollUpdate && |
- ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) { |
- content_view_core_->OnScrollUpdateGestureConsumed(); |
- } |
- if (gesture_event_type == blink::WebInputEvent::GestureScrollEnd) { |
+ } else if (event.type == blink::WebInputEvent::GestureScrollUpdate) { |
+ if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
+ content_view_core_->OnScrollUpdateGestureConsumed(); |
+ } else if (event.type == blink::WebInputEvent::GestureScrollEnd) { |
content_view_core_->OnScrollEndEventAck(); |
- } |
- |
- // Fling events. |
- if (gesture_event_type == blink::WebInputEvent::GestureFlingStart) { |
- content_view_core_->OnFlingStartEventAck(ack_result); |
+ } else if (event.type == blink::WebInputEvent::GestureFlingStart) { |
+ if (ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED || |
+ ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS) { |
+ const bool had_consumer = |
+ ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
+ content_view_core_->OnUnhandledFlingStartEventAck( |
+ had_consumer, |
+ event.data.flingStart.velocityX, |
+ event.data.flingStart.velocityY); |
+ } |
} |
} |
@@ -1241,7 +1243,6 @@ void RenderWidgetHostViewAndroid::SendTouchEvent( |
host_->ForwardTouchEventWithLatencyInfo(event, CreateLatencyInfo(event)); |
} |
- |
void RenderWidgetHostViewAndroid::SendMouseEvent( |
const blink::WebMouseEvent& event) { |
if (host_) |
@@ -1367,11 +1368,6 @@ void RenderWidgetHostViewAndroid::SetContentViewCore( |
if (content_view_core_ && !using_synchronous_compositor_) |
content_view_core_->GetWindowAndroid()->AddObserver(this); |
} |
- |
- // Ensure ContentsViewCore is aware of the current touch handling state, eg. |
- // in case we've already been running JS for the page as part of preload. |
- if (content_view_core_ && host_) |
- content_view_core_->HasTouchEventHandlers(host_->has_touch_handler()); |
} |
void RenderWidgetHostViewAndroid::RunAckCallbacks() { |
@@ -1383,8 +1379,6 @@ void RenderWidgetHostViewAndroid::RunAckCallbacks() { |
void RenderWidgetHostViewAndroid::HasTouchEventHandlers( |
bool need_touch_events) { |
- if (content_view_core_) |
- content_view_core_->HasTouchEventHandlers(need_touch_events); |
} |
void RenderWidgetHostViewAndroid::OnCompositingDidCommit() { |