| Index: content/browser/android/content_view_core_impl.cc
|
| diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
|
| index 38886f9d6d36195114d9847c44fc5546112cc6c0..609534029faf8d29647bbb542c404bcf2bf188f7 100644
|
| --- a/content/browser/android/content_view_core_impl.cc
|
| +++ b/content/browser/android/content_view_core_impl.cc
|
| @@ -552,36 +552,42 @@ void ContentViewCoreImpl::OnGestureEventAck(const blink::WebGestureEvent& event,
|
| }
|
| }
|
|
|
| -bool ContentViewCoreImpl::FilterInputEvent(const blink::WebInputEvent& event) {
|
| +InputEventAckState ContentViewCoreImpl::FilterInputEvent(
|
| + const blink::WebInputEvent& event) {
|
| if (event.type != WebInputEvent::GestureTap &&
|
| event.type != WebInputEvent::GestureDoubleTap &&
|
| event.type != WebInputEvent::GestureLongTap &&
|
| event.type != WebInputEvent::GestureLongPress &&
|
| - event.type != WebInputEvent::GestureFlingCancel)
|
| - return false;
|
| + event.type != WebInputEvent::GestureFlingCancel) {
|
| + return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
|
| + }
|
|
|
| JNIEnv* env = AttachCurrentThread();
|
| ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
|
| if (j_obj.is_null())
|
| - return false;
|
| + return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
|
|
|
| if (event.type == WebInputEvent::GestureFlingCancel) {
|
| // If no fling is active, either in the compositor or externally-driven,
|
| // there's no need to explicitly cancel the fling.
|
| bool may_need_fling_cancel =
|
| Java_ContentViewCore_isScrollInProgress(env, j_obj.obj());
|
| - return !may_need_fling_cancel;
|
| + return may_need_fling_cancel ? INPUT_EVENT_ACK_STATE_NOT_CONSUMED
|
| + : INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
|
| }
|
|
|
| const blink::WebGestureEvent& gesture =
|
| static_cast<const blink::WebGestureEvent&>(event);
|
| int gesture_type = ToGestureEventType(event.type);
|
| - return Java_ContentViewCore_filterTapOrPressEvent(env,
|
| - j_obj.obj(),
|
| - gesture_type,
|
| - gesture.x * dpi_scale(),
|
| - gesture.y * dpi_scale());
|
| + if (Java_ContentViewCore_filterTapOrPressEvent(env,
|
| + j_obj.obj(),
|
| + gesture_type,
|
| + gesture.x * dpi_scale(),
|
| + gesture.y * dpi_scale())) {
|
| + return INPUT_EVENT_ACK_STATE_CONSUMED;
|
| + }
|
|
|
| + return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
|
| // TODO(jdduke): Also report double-tap UMA, crbug/347568.
|
| }
|
|
|
|
|