Revert of [Android] Reland "Provide unhandled tap event notifications"...

Revert of [Android] Reland "Provide unhandled tap event notifications" (https://codereview.chromium.org/256213002/)

Reason for revert:
The test TouchCursorInTextfieldTest is failing flakily on Linux ChromiumOS Tests (2):

http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%282%29/builds/23460

The precondition CL crrev.com/218633008 also got previously reverted.

Original issue's description:
> [Android] Reland "Provide unhandled tap event notifications"
> 
> Allow notifications of unhandled taps via the GestureStateListener. This change
> makes GestureTap events blocking, but there are several use-cases for which this
> will be necessary, e.g., WebView and contextual search.
> 
> This was landed in r26143 and reverted in r261470 due to to a failure in
> TouchEditableImplAuraTest.TouchCursorInTextfieldTest. The test has been fixed
> and reviewed previously in crrev.com/218633008.
> 
> BUG=355154
> TBR=sky@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266732

TBR=jdduke@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=355154

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266832 0039d316-1c4b-4281-b951-d872f2087c98
parent ef2f0027
...@@ -599,12 +599,6 @@ void ContentViewCoreImpl::OnGestureEventAck(const blink::WebGestureEvent& event, ...@@ -599,12 +599,6 @@ void ContentViewCoreImpl::OnGestureEventAck(const blink::WebGestureEvent& event,
case WebInputEvent::GesturePinchEnd: case WebInputEvent::GesturePinchEnd:
Java_ContentViewCore_onPinchEndEventAck(env, j_obj.obj()); Java_ContentViewCore_onPinchEndEventAck(env, j_obj.obj());
break; 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());
}
break;
case WebInputEvent::GestureDoubleTap: case WebInputEvent::GestureDoubleTap:
Java_ContentViewCore_onDoubleTapEventAck(env, j_obj.obj()); Java_ContentViewCore_onDoubleTapEventAck(env, j_obj.obj());
break; break;
......
...@@ -1279,17 +1279,10 @@ TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) { ...@@ -1279,17 +1279,10 @@ TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) {
EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
// The GestureTapUnconfirmed is converted into a tap, as the touch action is // The GestureTapUnconfirmed is converted into a tap, as the touch action is
// none. // auto.
SimulateGestureEvent(WebInputEvent::GestureTapUnconfirmed, SimulateGestureEvent(WebInputEvent::GestureTapUnconfirmed,
WebGestureEvent::Touchscreen); WebGestureEvent::Touchscreen);
EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
// This test will become invalid if GestureTap stops requiring an ack.
ASSERT_FALSE(WebInputEventTraits::IgnoresAckDisposition(
GetEventWithType(WebInputEvent::GestureTap)));
EXPECT_EQ(2, client_->in_flight_event_count());
SendInputEventACK(WebInputEvent::GestureTap,
INPUT_EVENT_ACK_STATE_CONSUMED);
EXPECT_EQ(1, client_->in_flight_event_count());
// This tap gesture is dropped, since the GestureTapUnconfirmed was turned // This tap gesture is dropped, since the GestureTapUnconfirmed was turned
// into a tap. // into a tap.
...@@ -1311,10 +1304,8 @@ TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) { ...@@ -1311,10 +1304,8 @@ TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) {
SimulateGestureEvent(WebInputEvent::GestureDoubleTap, SimulateGestureEvent(WebInputEvent::GestureDoubleTap,
WebGestureEvent::Touchscreen); WebGestureEvent::Touchscreen);
// This test will become invalid if GestureDoubleTap stops requiring an ack. // This test will become invalid if GestureDoubleTap stops requiring an ack.
ASSERT_FALSE(WebInputEventTraits::IgnoresAckDisposition( DCHECK(!WebInputEventTraits::IgnoresAckDisposition(
GetEventWithType(WebInputEvent::GestureDoubleTap))); GetEventWithType(WebInputEvent::GestureDoubleTap)));
EXPECT_EQ(1, client_->in_flight_event_count());
SendInputEventACK(WebInputEvent::GestureTap, INPUT_EVENT_ACK_STATE_CONSUMED);
EXPECT_EQ(0, client_->in_flight_event_count()); EXPECT_EQ(0, client_->in_flight_event_count());
} }
......
...@@ -369,10 +369,9 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, ...@@ -369,10 +369,9 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
// Tap textfield // Tap textfield
touch_editable->Reset(); touch_editable->Reset();
generator.GestureTapAt(gfx::Point(bounds.x() + 50, bounds.y() + 40)); generator.GestureTapAt(gfx::Point(bounds.x() + 50, bounds.y() + 40));
// Tap Down acks are sent synchronously, while Tap acks are asynchronous. // Tap Down and Tap acks are sent synchronously.
touch_editable->Reset();
touch_editable->WaitForGestureAck();
touch_editable->WaitForSelectionChangeCallback(); touch_editable->WaitForSelectionChangeCallback();
touch_editable->Reset();
// Check if cursor handle is showing. // Check if cursor handle is showing.
EXPECT_NE(ui::TEXT_INPUT_TYPE_NONE, GetTextInputType(touch_editable)); EXPECT_NE(ui::TEXT_INPUT_TYPE_NONE, GetTextInputType(touch_editable));
......
...@@ -344,6 +344,7 @@ bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) { ...@@ -344,6 +344,7 @@ bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) {
case WebInputEvent::GestureScrollBegin: case WebInputEvent::GestureScrollBegin:
case WebInputEvent::GestureScrollEnd: case WebInputEvent::GestureScrollEnd:
case WebInputEvent::GestureShowPress: case WebInputEvent::GestureShowPress:
case WebInputEvent::GestureTap:
case WebInputEvent::GestureTapUnconfirmed: case WebInputEvent::GestureTapUnconfirmed:
case WebInputEvent::GestureTapDown: case WebInputEvent::GestureTapDown:
case WebInputEvent::GestureTapCancel: case WebInputEvent::GestureTapCancel:
......
...@@ -1304,15 +1304,6 @@ public class ContentViewCore ...@@ -1304,15 +1304,6 @@ public class ContentViewCore
updateGestureStateListener(GestureEventType.PINCH_END); updateGestureStateListener(GestureEventType.PINCH_END);
} }
@SuppressWarnings("unused")
@CalledByNative
private void onTapEventNotConsumed(int x, int y) {
for (mGestureStateListenersIterator.rewind();
mGestureStateListenersIterator.hasNext();) {
mGestureStateListenersIterator.next().onUnhandledTapEvent(x, y);
}
}
@SuppressWarnings("unused") @SuppressWarnings("unused")
@CalledByNative @CalledByNative
private void onDoubleTapEventAck() { private void onDoubleTapEventAck() {
......
...@@ -61,9 +61,4 @@ public class GestureStateListener { ...@@ -61,9 +61,4 @@ public class GestureStateListener {
* Called when the scroll offsets or extents may have changed. * Called when the scroll offsets or extents may have changed.
*/ */
public void onScrollOffsetOrExtentChanged(int scrollOffsetY, int scrollExtentY) {} public void onScrollOffsetOrExtentChanged(int scrollOffsetY, int scrollExtentY) {}
/*
* Called when a tap event was not handled by the renderer.
*/
public void onUnhandledTapEvent(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