Commit 67ef3cbd authored by jdduke@chromium.org's avatar jdduke@chromium.org

[Android] Add GestureStateListener hook for all single-tap event acks

Previously, GestureStateListener provided a method for listening to unhandled
tap events.  Expand this to include handled taps, useful for logging general
site interaction metrics.

BUG=374335

Review URL: https://codereview.chromium.org/286243004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271227 0039d316-1c4b-4281-b951-d872f2087c98
parent 1c4a23ff
......@@ -591,10 +591,12 @@ void ContentViewCoreImpl::OnGestureEventAck(const blink::WebGestureEvent& event,
Java_ContentViewCore_onPinchEndEventAck(env, j_obj.obj());
break;
case WebInputEvent::GestureTap:
if (ack_result != INPUT_EVENT_ACK_STATE_CONSUMED) {
Java_ContentViewCore_onTapEventNotConsumed(
env, j_obj.obj(), event.x * dpi_scale(), event.y * dpi_scale());
}
Java_ContentViewCore_onSingleTapEventAck(
env,
j_obj.obj(),
ack_result == INPUT_EVENT_ACK_STATE_CONSUMED,
event.x * dpi_scale(),
event.y * dpi_scale());
break;
case WebInputEvent::GestureDoubleTap:
Java_ContentViewCore_onDoubleTapEventAck(env, j_obj.obj());
......
......@@ -1187,10 +1187,10 @@ public class ContentViewCore
@SuppressWarnings("unused")
@CalledByNative
private void onTapEventNotConsumed(int x, int y) {
private void onSingleTapEventAck(boolean consumed, int x, int y) {
for (mGestureStateListenersIterator.rewind();
mGestureStateListenersIterator.hasNext();) {
mGestureStateListenersIterator.next().onUnhandledTapEvent(x, y);
mGestureStateListenersIterator.next().onSingleTap(consumed, x, y);
}
}
......
......@@ -63,7 +63,8 @@ public class GestureStateListener {
public void onScrollOffsetOrExtentChanged(int scrollOffsetY, int scrollExtentY) {}
/*
* Called when a tap event was not handled by the renderer.
* Called after a single-tap gesture event was dispatched to the renderer,
* indicating whether or not the gesture was consumed.
*/
public void onUnhandledTapEvent(int x, int y) {}
public void onSingleTap(boolean consumed, int x, int y) {}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment