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

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

Issue 27220002: [Android] Properly handle cancelled scroll events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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.util.Log; 8 import android.util.Log;
9 import android.view.MotionEvent; 9 import android.view.MotionEvent;
10 import android.view.ScaleGestureDetector; 10 import android.view.ScaleGestureDetector;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 // Passes the touch event to ScaleGestureDetector so that its internal state 117 // Passes the touch event to ScaleGestureDetector so that its internal state
118 // won't go wrong. ScaleGestureDetector needs two pointers in a MotionEvent 118 // won't go wrong. ScaleGestureDetector needs two pointers in a MotionEvent
119 // to recognize a zoom gesture. 119 // to recognize a zoom gesture.
120 boolean processTouchEvent(MotionEvent event) { 120 boolean processTouchEvent(MotionEvent event) {
121 // TODO: Need to deal with multi-touch transition 121 // TODO: Need to deal with multi-touch transition
122 mMultiTouchListener.setTemporarilyIgnoreDetectorEvents(false); 122 mMultiTouchListener.setTemporarilyIgnoreDetectorEvents(false);
123 try { 123 try {
124 boolean inGesture = isScaleGestureDetectionInProgress(); 124 boolean inGesture = isScaleGestureDetectionInProgress();
125 boolean retVal = mMultiTouchDetector.onTouchEvent(event); 125 boolean retVal = mMultiTouchDetector.onTouchEvent(event);
126 if (event.getActionMasked() == MotionEvent.ACTION_UP && !inGesture) return false; 126 if (!inGesture && (event.getActionMasked() == MotionEvent.ACTION_UP
127 || event.getActionMasked() == MotionEvent.ACTION_CANCEL)) re turn false;
Ted C 2013/10/14 20:05:38 braces needed since the conditional no longer fits
cjhopman 2013/10/14 20:37:09 Done.
127 return retVal; 128 return retVal;
128 } catch (Exception e) { 129 } catch (Exception e) {
129 Log.e(TAG, "ScaleGestureDetector got into a bad state!", e); 130 Log.e(TAG, "ScaleGestureDetector got into a bad state!", e);
130 assert(false); 131 assert(false);
131 } 132 }
132 return false; 133 return false;
133 } 134 }
134 135
135 void updateMultiTouchSupport(boolean supportsMultiTouchZoom) { 136 void updateMultiTouchSupport(boolean supportsMultiTouchZoom) {
136 mMultiTouchListener.setPermanentlyIgnoreDetectorEvents(!supportsMultiTou chZoom); 137 mMultiTouchListener.setPermanentlyIgnoreDetectorEvents(!supportsMultiTou chZoom);
137 } 138 }
138 } 139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698