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

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

Issue 11195033: Upstream hooks for javascript touch handlers on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 243c5e05c1ae13ad0b51cf977e9fbe6cbd26063b..6bba091a3859708b2cd13715816786a9fa6acb94 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
@@ -67,7 +67,7 @@ class ContentViewGestureHandler implements LongPressDelegate {
new ArrayDeque<Pair<MotionEvent, Boolean>>();
// Has WebKit told us the current page requires touch events.
- private boolean mNeedTouchEvents = false;
+ private boolean mHasTouchHandlers = false;
// Remember whether onShowPress() is called. If it is not, in onSingleTapConfirmed()
// we will first show the press state, then trigger the click.
@@ -606,19 +606,19 @@ class ContentViewGestureHandler implements LongPressDelegate {
/**
* Sets the flag indicating that the content has registered listeners for touch events.
*/
- void didSetNeedTouchEvents(boolean needTouchEvents) {
- mNeedTouchEvents = needTouchEvents;
+ void hasTouchEventHandlers(boolean hasTouchHandlers) {
+ mHasTouchHandlers = hasTouchHandlers;
// When mainframe is loading, FrameLoader::transitionToCommitted will
- // call this method to set mNeedTouchEvents to false. We use this as
+ // call this method to set mHasTouchHandlers to false. We use this as
// an indicator to clear the pending motion events so that events from
// the previous page will not be carried over to the new page.
- if (!mNeedTouchEvents) mPendingMotionEvents.clear();
+ if (!mHasTouchHandlers) mPendingMotionEvents.clear();
}
private boolean offerTouchEventToJavaScript(MotionEvent event) {
mLongPressDetector.onOfferTouchEventToJavaScript(event);
- if (!mNeedTouchEvents) return false;
+ if (!mHasTouchHandlers) return false;
if (event.getActionMasked() == MotionEvent.ACTION_MOVE) {
// Only send move events if the move has exceeded the slop threshold.
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698