summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-03-05 11:39:01 -0500
committerGrace Kloba <klobag@google.com>2010-03-09 11:33:41 -0800
commit6ed4a4e9a23ead7c910239171daf02b8fbecc17b (patch)
tree481f3029333ec03e0f3952cdc1088f46f2c64242 /WebKit/android
parentfa26a8dd531dff44d6cad0700ff32c0bb949392c (diff)
downloadexternal_webkit-6ed4a4e9a23ead7c910239171daf02b8fbecc17b.zip
external_webkit-6ed4a4e9a23ead7c910239171daf02b8fbecc17b.tar.gz
external_webkit-6ed4a4e9a23ead7c910239171daf02b8fbecc17b.tar.bz2
Only call plugin touch code if it is in full screen
mode or it is the document focused node. Remove Android special code added to support prevent default for double tap and long press. Long press and double tap needs to call preventDefault if it is needed. Remove Android special code added to pass event time. Need a separate CL for android_npapi.
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp12
-rw-r--r--WebKit/android/jni/WebViewCore.h2
-rw-r--r--WebKit/android/plugins/PluginDebugAndroid.cpp6
-rw-r--r--WebKit/android/plugins/SkANP.cpp7
-rw-r--r--WebKit/android/plugins/SkANP.h1
5 files changed, 9 insertions, 19 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 53f2b24..9cbeb71 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1962,9 +1962,9 @@ void WebViewCore::click(WebCore::Frame* frame, WebCore::Node* node) {
}
}
-int WebViewCore::handleTouchEvent(int action, int x, int y, long time, int metaState)
+bool WebViewCore::handleTouchEvent(int action, int x, int y, int metaState)
{
- int preventDefault = 0;
+ bool preventDefault = false;
#if USE(ACCELERATED_COMPOSITING)
RenderView* contentRenderer = m_mainFrame->contentRenderer();
@@ -2018,7 +2018,7 @@ int WebViewCore::handleTouchEvent(int action, int x, int y, long time, int metaS
m_lastTouchPoint = pt;
- WebCore::PlatformTouchEvent te(pt, type, touchState, time, metaState);
+ WebCore::PlatformTouchEvent te(pt, type, touchState, metaState);
preventDefault = m_mainFrame->eventHandler()->handleTouchEvent(te);
#endif
@@ -2711,14 +2711,14 @@ static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr,
return ret;
}
-static jint HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jint x, jint y, jlong time, jint metaState)
+static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jint x, jint y, jint metaState)
{
#ifdef ANDROID_INSTRUMENT
TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
#endif
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__);
- return viewImpl->handleTouchEvent(action, x, y, time, metaState);
+ return viewImpl->handleTouchEvent(action, x, y, metaState);
}
static void TouchUp(JNIEnv *env, jobject obj, jint touchGeneration,
@@ -3121,7 +3121,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) SaveDocumentState },
{ "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;",
(void*) FindAddress },
- { "nativeHandleTouchEvent", "(IIIJI)I",
+ { "nativeHandleTouchEvent", "(IIII)Z",
(void*) HandleTouchEvent },
{ "nativeTouchUp", "(IIIII)V",
(void*) TouchUp },
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index b7b931d..7883cdd 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -290,7 +290,7 @@ namespace android {
/**
* Handle touch event
*/
- int handleTouchEvent(int action, int x, int y, long time, int metaState);
+ bool handleTouchEvent(int action, int x, int y, int metaState);
/**
* Handle motionUp event from the UI thread (called touchUp in the
diff --git a/WebKit/android/plugins/PluginDebugAndroid.cpp b/WebKit/android/plugins/PluginDebugAndroid.cpp
index e783419..e13e928 100644
--- a/WebKit/android/plugins/PluginDebugAndroid.cpp
+++ b/WebKit/android/plugins/PluginDebugAndroid.cpp
@@ -93,10 +93,8 @@ void anp_logPluginEvent(void* npp, const ANPEvent* evt, int16 returnVal, int ela
case kTouch_ANPEventType:
if(evt->data.touch.action < ARRAY_COUNT(inputActions)) {
- uint32_t totalTime = android::uptimeMillis() - evt->timeStamp;
-
- anp_logPlugin("%p EVENT::TOUCH[%d] delay=%d time=%d action=%s [%d %d]",
- npp, returnVal, totalTime - elapsedTime, elapsedTime,
+ anp_logPlugin("%p EVENT::TOUCH[%d] time=%d action=%s [%d %d]",
+ npp, returnVal, elapsedTime,
inputActions[evt->data.touch.action], evt->data.touch.x,
evt->data.touch.y);
} else {
diff --git a/WebKit/android/plugins/SkANP.cpp b/WebKit/android/plugins/SkANP.cpp
index bb3fe45..720387d 100644
--- a/WebKit/android/plugins/SkANP.cpp
+++ b/WebKit/android/plugins/SkANP.cpp
@@ -103,11 +103,4 @@ bool SkANP::SetBitmap(ANPBitmap* dst, const SkBitmap& src) {
void SkANP::InitEvent(ANPEvent* event, ANPEventType et) {
event->inSize = sizeof(ANPEvent);
event->eventType = et;
- event->timeStamp = currentTime() * 1000.0;
-}
-
-void SkANP::InitEvent(ANPEvent* event, ANPEventType et, long time) {
- event->inSize = sizeof(ANPEvent);
- event->eventType = et;
- event->timeStamp = time;
}
diff --git a/WebKit/android/plugins/SkANP.h b/WebKit/android/plugins/SkANP.h
index 8590e10..5c2a936 100644
--- a/WebKit/android/plugins/SkANP.h
+++ b/WebKit/android/plugins/SkANP.h
@@ -74,7 +74,6 @@ public:
static bool SetBitmap(ANPBitmap* dst, const SkBitmap& src);
static void InitEvent(ANPEvent* event, ANPEventType et);
- static void InitEvent(ANPEvent* event, ANPEventType et, long time);
};
#endif