| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
|
| index deffcc65589b2b79b42b1dc22150840d5a3bccca..82624c1758bdbb897b7fed33e77bb338a65640bc 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
|
| @@ -107,13 +107,6 @@ class ContentViewGestureHandler implements LongPressDelegate {
|
|
|
| private boolean mPinchInProgress = false;
|
|
|
| - // Tracks whether a touch cancel event has been sent as a result of switching
|
| - // into scrolling or pinching mode.
|
| - private boolean mTouchCancelEventSent = false;
|
| -
|
| - // Last cancelled touch event as a result of scrolling or pinching.
|
| - private MotionEvent mLastCancelledEvent = null;
|
| -
|
| private static final int DOUBLE_TAP_TIMEOUT = ViewConfiguration.getDoubleTapTimeout();
|
|
|
| //On single tap this will store the x, y coordinates of the touch.
|
| @@ -977,8 +970,6 @@ class ContentViewGestureHandler implements LongPressDelegate {
|
| if (type == TouchPoint.CONVERSION_ERROR) return EVENT_NOT_FORWARDED;
|
|
|
| if (!mTouchScrolling && !mPinchInProgress) {
|
| - mTouchCancelEventSent = false;
|
| -
|
| if (mMotionEventDelegate.sendTouchEvent(event.getEventTime(), type, pts)) {
|
| // If confirmTouchEvent() is called synchronously with respect to sendTouchEvent(),
|
| // then |event| will have been recycled. Only start the timer if the sent event has
|
| @@ -991,18 +982,6 @@ class ContentViewGestureHandler implements LongPressDelegate {
|
| }
|
| return EVENT_FORWARDED_TO_NATIVE;
|
| }
|
| - } else if (!mTouchCancelEventSent) {
|
| - mTouchCancelEventSent = true;
|
| -
|
| - MotionEvent previousCancelEvent = mLastCancelledEvent;
|
| - mLastCancelledEvent = event;
|
| -
|
| - if (mMotionEventDelegate.sendTouchEvent(event.getEventTime(),
|
| - TouchPoint.TOUCH_EVENT_TYPE_CANCEL, pts)) {
|
| - return EVENT_CONVERTED_TO_CANCEL;
|
| - } else {
|
| - mLastCancelledEvent = previousCancelEvent;
|
| - }
|
| }
|
| return EVENT_NOT_FORWARDED;
|
| }
|
| @@ -1082,12 +1061,6 @@ class ContentViewGestureHandler implements LongPressDelegate {
|
| }
|
|
|
| MotionEvent ackedEvent = mPendingMotionEvents.removeFirst();
|
| - if (ackedEvent == mLastCancelledEvent) {
|
| - // The event is canceled, just drain all the pending events until next
|
| - // touch down.
|
| - ackResult = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
|
| - TraceEvent.instant("confirmTouchEvent:CanceledEvent");
|
| - }
|
| switch (ackResult) {
|
| case INPUT_EVENT_ACK_STATE_UNKNOWN:
|
| // This should never get sent.
|
| @@ -1150,9 +1123,6 @@ class ContentViewGestureHandler implements LongPressDelegate {
|
| }
|
|
|
| private void recycleEvent(MotionEvent event) {
|
| - if (event == mLastCancelledEvent) {
|
| - mLastCancelledEvent = null;
|
| - }
|
| event.recycle();
|
| }
|
|
|
| @@ -1217,14 +1187,6 @@ class ContentViewGestureHandler implements LongPressDelegate {
|
|
|
| /**
|
| * This is for testing only.
|
| - * @return Whether the motion event is cancelled.
|
| - */
|
| - boolean isEventCancelledForTesting(MotionEvent event) {
|
| - return event != null && event == mLastCancelledEvent;
|
| - }
|
| -
|
| - /**
|
| - * This is for testing only.
|
| * @return The number of motion events on the pending motion events queue.
|
| */
|
| int getNumberOfPendingMotionEventsForTesting() {
|
|
|