summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-24 14:31:43 -0700
committerJohn Reck <jreck@google.com>2012-05-24 17:54:31 -0700
commit91f41286e33b387859e4841711f3054bcf75c748 (patch)
tree383ce5fea572c95125d9b9b3fd826d5499bcc466 /Source/WebKit/android/jni/WebViewCore.cpp
parente5d2bf33ff91f1c00fb2ecd73879ba8d3a8298a7 (diff)
downloadexternal_webkit-91f41286e33b387859e4841711f3054bcf75c748.zip
external_webkit-91f41286e33b387859e4841711f3054bcf75c748.tar.gz
external_webkit-91f41286e33b387859e4841711f3054bcf75c748.tar.bz2
Support skipping a touch stream due to lack of handlers
Bug: 6317798 Change-Id: I8c4cd3bf4c538aff202ed0e3f84982fb112936a1
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 9d81edc..3d86761 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -178,6 +178,9 @@ FILE* gRenderTreeFile = 0;
// prerenders
#define PRERENDER_AFTER_SCROLL_DELAY 750
+#define TOUCH_FLAG_HIT_HANDLER 0x1
+#define TOUCH_FLAG_PREVENT_DEFAULT 0x2
+
////////////////////////////////////////////////////////////////////////////////////////////////
namespace android {
@@ -3185,9 +3188,9 @@ GraphicsLayerAndroid* WebViewCore::graphicsRootLayer() const
}
#endif
-bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint>& points, int actionIndex, int metaState)
+int WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint>& points, int actionIndex, int metaState)
{
- bool preventDefault = false;
+ int flags = 0;
#if USE(ACCELERATED_COMPOSITING)
GraphicsLayerAndroid* rootLayer = graphicsRootLayer();
@@ -3251,14 +3254,17 @@ bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint
}
WebCore::PlatformTouchEvent te(ids, points, type, touchStates, metaState);
- preventDefault = m_mainFrame->eventHandler()->handleTouchEvent(te);
+ if (m_mainFrame->eventHandler()->handleTouchEvent(te))
+ flags |= TOUCH_FLAG_PREVENT_DEFAULT;
+ if (te.hitTouchHandler())
+ flags |= TOUCH_FLAG_HIT_HANDLER;
#endif
#if USE(ACCELERATED_COMPOSITING)
if (rootLayer)
rootLayer->pauseDisplay(false);
#endif
- return preventDefault;
+ return flags;
}
bool WebViewCore::performMouseClick()
@@ -4596,7 +4602,7 @@ static jstring FindAddress(JNIEnv* env, jobject obj, jstring addr,
return ret;
}
-static jboolean HandleTouchEvent(JNIEnv* env, jobject obj, jint nativeClass,
+static jint HandleTouchEvent(JNIEnv* env, jobject obj, jint nativeClass,
jint action, jintArray idArray, jintArray xArray, jintArray yArray,
jint count, jint actionIndex, jint metaState)
{
@@ -5037,7 +5043,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) SaveDocumentState },
{ "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;",
(void*) FindAddress },
- { "nativeHandleTouchEvent", "(II[I[I[IIII)Z",
+ { "nativeHandleTouchEvent", "(II[I[I[IIII)I",
(void*) HandleTouchEvent },
{ "nativeMouseClick", "(I)Z",
(void*) MouseClick },