Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java

Issue 27220002: [Android] Properly handle cancelled scroll events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests detect this as a fling??!? Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ZoomManager.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Bundle; 8 import android.os.Bundle;
9 import android.os.Handler; 9 import android.os.Handler;
10 import android.os.SystemClock; 10 import android.os.SystemClock;
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 private boolean processTouchEvent(MotionEvent event) { 989 private boolean processTouchEvent(MotionEvent event) {
990 boolean handled = false; 990 boolean handled = false;
991 // The last "finger up" is an end to scrolling but may not be 991 // The last "finger up" is an end to scrolling but may not be
992 // an end to movement (e.g. fling scroll). We do not tell 992 // an end to movement (e.g. fling scroll). We do not tell
993 // native code to end scrolling until we are sure we did not 993 // native code to end scrolling until we are sure we did not
994 // fling. 994 // fling.
995 boolean possiblyEndMovement = false; 995 boolean possiblyEndMovement = false;
996 // "Last finger raised" could be an end to movement. However, 996 // "Last finger raised" could be an end to movement. However,
997 // give the mSimpleTouchDetector a chance to continue 997 // give the mSimpleTouchDetector a chance to continue
998 // scrolling with a fling. 998 // scrolling with a fling.
999 if (event.getAction() == MotionEvent.ACTION_UP) { 999 if (event.getAction() == MotionEvent.ACTION_UP
1000 || event.getAction() == MotionEvent.ACTION_CANCEL) {
1000 if (mTouchScrolling) { 1001 if (mTouchScrolling) {
1001 possiblyEndMovement = true; 1002 possiblyEndMovement = true;
1002 } 1003 }
1003 } 1004 }
1004 1005
1005 mLongPressDetector.cancelLongPressIfNeeded(event); 1006 mLongPressDetector.cancelLongPressIfNeeded(event);
1006 mLongPressDetector.startLongPressTimerIfNeeded(event); 1007 mLongPressDetector.startLongPressTimerIfNeeded(event);
1007 1008
1008 // Use the framework's GestureDetector to detect pans and zooms not alre ady 1009 // Use the framework's GestureDetector to detect pans and zooms not alre ady
1009 // handled by the WebKit touch events gesture manager. 1010 // handled by the WebKit touch events gesture manager.
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 assert (mDoubleTapDragMode == DOUBLE_TAP_DRAG_MODE_DISABLED || 1216 assert (mDoubleTapDragMode == DOUBLE_TAP_DRAG_MODE_DISABLED ||
1216 mDoubleTapDragMode == DOUBLE_TAP_DRAG_MODE_NONE); 1217 mDoubleTapDragMode == DOUBLE_TAP_DRAG_MODE_NONE);
1217 mDoubleTapDragMode = supportDoubleTapDrag ? 1218 mDoubleTapDragMode = supportDoubleTapDrag ?
1218 DOUBLE_TAP_DRAG_MODE_NONE : DOUBLE_TAP_DRAG_MODE_DISABLED; 1219 DOUBLE_TAP_DRAG_MODE_NONE : DOUBLE_TAP_DRAG_MODE_DISABLED;
1219 } 1220 }
1220 1221
1221 private boolean isDoubleTapDragDisabled() { 1222 private boolean isDoubleTapDragDisabled() {
1222 return mDoubleTapDragMode == DOUBLE_TAP_DRAG_MODE_DISABLED; 1223 return mDoubleTapDragMode == DOUBLE_TAP_DRAG_MODE_DISABLED;
1223 } 1224 }
1224 } 1225 }
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ZoomManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698