summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-24 18:15:40 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-24 18:15:40 -0700
commite0d7d53d0af7715347bc694de7b140773174149e (patch)
treec423f0dbde9d6ec9d60495d4096a04f94059b369 /Source/WebKit/android/jni/WebViewCore.cpp
parent3551374e25ca65d153ff3c3ffe7f7c79095d6025 (diff)
parent8959907b97e269d7183d4817f295234718b41365 (diff)
downloadexternal_webkit-e0d7d53d0af7715347bc694de7b140773174149e.zip
external_webkit-e0d7d53d0af7715347bc694de7b140773174149e.tar.gz
external_webkit-e0d7d53d0af7715347bc694de7b140773174149e.tar.bz2
am 8959907b: am 91f41286: Support skipping a touch stream due to lack of handlers
* commit '8959907b97e269d7183d4817f295234718b41365': Support skipping a touch stream due to lack of handlers
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 874a812..1e87b6e 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)
{
@@ -5011,7 +5017,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 },