diff options
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index afbf135..27ced0e 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -2764,7 +2764,7 @@ bool WebViewCore::key(const PlatformKeyboardEvent& event) // change its selection. In the case that it does not, we want to // return false so that the key will be sent back to our navigation // system. - handled = frame->selection()->selection() != old; + handled |= frame->selection()->selection() != old; } return handled; } else { @@ -2808,7 +2808,7 @@ GraphicsLayerAndroid* WebViewCore::graphicsRootLayer() const } #endif -bool WebViewCore::handleTouchEvent(int action, Vector<IntPoint>& points, int metaState) +bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint>& points, int metaState) { bool preventDefault = false; @@ -2859,7 +2859,7 @@ bool WebViewCore::handleTouchEvent(int action, Vector<IntPoint>& points, int met points[c].setX(points[c].x() - m_scrollOffsetX); points[c].setY(points[c].y() - m_scrollOffsetY); } - WebCore::PlatformTouchEvent te(points, type, touchState, metaState); + WebCore::PlatformTouchEvent te(ids, points, type, touchState, metaState); preventDefault = m_mainFrame->eventHandler()->handleTouchEvent(te); #endif @@ -3784,7 +3784,7 @@ static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr, return ret; } -static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, +static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jintArray idArray, jintArray xArray, jintArray yArray, jint count, jint metaState) { #ifdef ANDROID_INSTRUMENT @@ -3792,17 +3792,21 @@ static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, #endif WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); + jint* ptrIdArray = env->GetIntArrayElements(idArray, 0); jint* ptrXArray = env->GetIntArrayElements(xArray, 0); jint* ptrYArray = env->GetIntArrayElements(yArray, 0); + Vector<int> ids(count); Vector<IntPoint> points(count); for (int c = 0; c < count; c++) { + ids[c] = ptrIdArray[c]; points[c].setX(ptrXArray[c]); points[c].setY(ptrYArray[c]); } + env->ReleaseIntArrayElements(idArray, ptrIdArray, JNI_ABORT); env->ReleaseIntArrayElements(xArray, ptrXArray, JNI_ABORT); env->ReleaseIntArrayElements(yArray, ptrYArray, JNI_ABORT); - return viewImpl->handleTouchEvent(action, points, metaState); + return viewImpl->handleTouchEvent(action, ids, points, metaState); } static void TouchUp(JNIEnv *env, jobject obj, jint touchGeneration, @@ -4228,7 +4232,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) SaveDocumentState }, { "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;", (void*) FindAddress }, - { "nativeHandleTouchEvent", "(I[I[III)Z", + { "nativeHandleTouchEvent", "(I[I[I[III)Z", (void*) HandleTouchEvent }, { "nativeTouchUp", "(IIIII)V", (void*) TouchUp }, |