summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-02-02 19:08:41 -0800
committerGrace Kloba <klobag@google.com>2010-02-02 19:08:41 -0800
commit4ed2b1c34b2dd0e2bd2f403a6f3de0bdbf473b98 (patch)
treeae8f911df9ffd3e836e1fd8a4fc752fa69e69809 /core/java/android
parente7b2845d685a583e8e84de369b6acfa1bebeabf4 (diff)
Pass touch event time from Java to WebKit
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/webkit/WebView.java3
-rw-r--r--core/java/android/webkit/WebViewCore.java5
2 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 5d3a8bfebce0..4f5207889fde 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4144,6 +4144,7 @@ public class WebView extends AbsoluteLayout
ted.mAction = action;
ted.mX = viewToContentX((int) x + mScrollX);
ted.mY = viewToContentY((int) y + mScrollY);
+ ted.mEventTime = eventTime;
mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
mLastSentTouchTime = eventTime;
}
@@ -4415,6 +4416,7 @@ public class WebView extends AbsoluteLayout
ted.mAction = WebViewCore.ACTION_DOUBLETAP;
ted.mX = viewToContentX((int) x + mScrollX);
ted.mY = viewToContentY((int) y + mScrollY);
+ ted.mEventTime = eventTime;
mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
} else if (mFullScreenHolder == null) {
doDoubleTap();
@@ -5430,6 +5432,7 @@ public class WebView extends AbsoluteLayout
ted.mAction = WebViewCore.ACTION_LONGPRESS;
ted.mX = viewToContentX((int) mLastTouchX + mScrollX);
ted.mY = viewToContentY((int) mLastTouchY + mScrollY);
+ ted.mEventTime = SystemClock.uptimeMillis();
mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
} else if (mPreventDrag == PREVENT_DRAG_NO) {
mTouchMode = TOUCH_DONE_MODE;
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 885dda9a66d1..ed35f2694a2c 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -512,7 +512,7 @@ final class WebViewCore {
private native void nativeTouchUp(int touchGeneration,
int framePtr, int nodePtr, int x, int y);
- private native int nativeHandleTouchEvent(int action, int x, int y);
+ private native int nativeHandleTouchEvent(int action, int x, int y, long time);
private native void nativeUpdateFrameCache();
@@ -726,6 +726,7 @@ final class WebViewCore {
int mAction;
int mX;
int mY;
+ long mEventTime;
}
static class GeolocationPermissionsData {
@@ -1168,7 +1169,7 @@ final class WebViewCore {
mWebView.mPrivateHandler,
WebView.PREVENT_TOUCH_ID, ted.mAction,
nativeHandleTouchEvent(ted.mAction, ted.mX,
- ted.mY)).sendToTarget();
+ ted.mY, ted.mEventTime)).sendToTarget();
break;
}