summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 135d1b2..0b7e63b 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -2052,9 +2052,9 @@ void WebViewCore::click(WebCore::Frame* frame, WebCore::Node* node) {
}
}
-bool WebViewCore::handleTouchEvent(int action, int x, int y)
+int WebViewCore::handleTouchEvent(int action, int x, int y)
{
- bool preventDefault = false;
+ int preventDefault = 0;
#if ENABLE(TOUCH_EVENTS) // Android
WebCore::TouchEventType type = WebCore::TouchEventCancel;
@@ -2071,6 +2071,12 @@ bool WebViewCore::handleTouchEvent(int action, int x, int y)
case 3: // MotionEvent.ACTION_CANCEL
type = WebCore::TouchEventCancel;
break;
+ case 0x100: // WebViewCore.ACTION_LONGPRESS
+ type = WebCore::TouchEventLongPress;
+ break;
+ case 0x200: // WebViewCore.ACTION_DOUBLETAP
+ type = WebCore::TouchEventDoubleTap;
+ break;
}
WebCore::IntPoint pt(x - m_scrollOffsetX, y - m_scrollOffsetY);
WebCore::PlatformTouchEvent te(pt, pt, type);
@@ -2829,7 +2835,7 @@ static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr,
return ret;
}
-static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jint x, jint y)
+static jint HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jint x, jint y)
{
#ifdef ANDROID_INSTRUMENT
TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
@@ -3216,7 +3222,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) SaveDocumentState },
{ "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;",
(void*) FindAddress },
- { "nativeHandleTouchEvent", "(III)Z",
+ { "nativeHandleTouchEvent", "(III)I",
(void*) HandleTouchEvent },
{ "nativeTouchUp", "(IIIII)V",
(void*) TouchUp },