summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp8
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.h2
-rw-r--r--WebKit/android/jni/WebViewCore.cpp30
-rw-r--r--WebKit/android/jni/WebViewCore.h4
-rw-r--r--WebKit/android/nav/WebView.cpp7
-rw-r--r--WebKit/android/plugins/PluginWidgetAndroid.cpp10
6 files changed, 24 insertions, 37 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
index ffa96f8..17dc0d0 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
@@ -71,8 +71,10 @@ void ChromeClientAndroid::compositingLayerSync()
frameView->syncCompositingStateRecursive();
GraphicsLayerAndroid* androidGraphicsLayer =
static_cast<GraphicsLayerAndroid*>(m_rootGraphicsLayer);
- if (androidGraphicsLayer)
+ if (androidGraphicsLayer) {
androidGraphicsLayer->sendImmediateRepaint();
+ androidGraphicsLayer->notifyClientAnimationStarted();
+ }
return;
}
}
@@ -466,12 +468,12 @@ void ChromeClientAndroid::wakeUpMainThreadWithNewQuota(long newQuota) {
}
#if ENABLE(TOUCH_EVENTS)
-void ChromeClientAndroid::needTouchEvents(bool needTouchEvents, bool force)
+void ChromeClientAndroid::needTouchEvents(bool needTouchEvents)
{
FrameView* frameView = m_webFrame->page()->mainFrame()->view();
android::WebViewCore* core = android::WebViewCore::getWebViewCore(frameView);
if (core)
- core->needTouchEvents(needTouchEvents, force);
+ core->needTouchEvents(needTouchEvents);
}
#endif
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
index b61f9fd..15bf52a 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
@@ -137,7 +137,7 @@ namespace android {
virtual void populateVisitedLinks();
#if ENABLE(TOUCH_EVENTS)
- virtual void needTouchEvents(bool, bool);
+ virtual void needTouchEvents(bool);
#endif
// Methods used to request and provide Geolocation permissions.
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 9778ea0..ae3e47c 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -268,7 +268,9 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
m_screenWidth = 320;
m_scale = 1;
m_screenWidthScale = 1;
- m_touchEventListenerCount = 0;
+#if ENABLE(TOUCH_EVENTS)
+ m_forwardingTouchEvents = false;
+#endif
LOG_ASSERT(m_mainFrame, "Uh oh, somehow a frameview was made without an initial frame!");
@@ -998,28 +1000,20 @@ void WebViewCore::restoreScreenWidthScale(int scale)
checkException(env);
}
-void WebViewCore::needTouchEvents(bool need, bool force)
+void WebViewCore::needTouchEvents(bool need)
{
DEBUG_NAV_UI_LOGD("%s", __FUNCTION__);
LOG_ASSERT(m_javaGlue->m_obj, "A Java widget was not associated with this view bridge!");
-#if ENABLE(TOUCH_EVENTS) // Android
- bool needToUpdateJava = false;
- if (need) {
- if (++m_touchEventListenerCount == 1)
- needToUpdateJava = true;
- } else {
- if (force)
- m_touchEventListenerCount = 0;
- else if (--m_touchEventListenerCount == 0)
- needToUpdateJava = true;
- }
+#if ENABLE(TOUCH_EVENTS)
+ if (m_forwardingTouchEvents == need)
+ return;
- if (needToUpdateJava || force) {
- JNIEnv* env = JSC::Bindings::getJNIEnv();
- env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_needTouchEvents, need);
- checkException(env);
- }
+ JNIEnv* env = JSC::Bindings::getJNIEnv();
+ env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_needTouchEvents, need);
+ checkException(env);
+
+ m_forwardingTouchEvents = need;
#endif
}
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index f528c73..2252878 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -375,7 +375,7 @@ namespace android {
Node* cursorNodeIsPlugin();
// Notify the Java side whether it needs to pass down the touch events
- void needTouchEvents(bool, bool);
+ void needTouchEvents(bool);
// Notify the Java side that webkit is requesting a keyboard
void requestKeyboard(bool showKeyboard, bool isTextView);
@@ -536,7 +536,7 @@ namespace android {
WebCore::HTMLAnchorElement* retrieveAnchorElement(WebCore::Frame* frame, WebCore::Node* node);
#if ENABLE(TOUCH_EVENTS)
- int m_touchEventListenerCount;
+ bool m_forwardingTouchEvents;
IntPoint m_lastTouchPoint;
#endif
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index dae93fc..e2a7708 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -1533,13 +1533,10 @@ static void nativeDrawLayers(JNIEnv *env, jobject obj,
#endif
}
-static void nativeUpdateLayers(JNIEnv *env, jobject obj,
- jint layer, jint updates)
+static void nativeUpdateLayers(JNIEnv *env, jobject obj, jint updates)
{
if (!env)
return;
- if (!layer)
- return;
if (!updates)
return;
@@ -2138,7 +2135,7 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeEvaluateLayersAnimations },
{ "nativeDrawLayers", "(IIIIIFLandroid/graphics/Canvas;)V",
(void*) nativeDrawLayers },
- { "nativeUpdateLayers", "(II)V",
+ { "nativeUpdateLayers", "(I)V",
(void*) nativeUpdateLayers },
{ "nativeDrawMatches", "(Landroid/graphics/Canvas;)V",
(void*) nativeDrawMatches },
diff --git a/WebKit/android/plugins/PluginWidgetAndroid.cpp b/WebKit/android/plugins/PluginWidgetAndroid.cpp
index 2ea3191..7109ab4 100644
--- a/WebKit/android/plugins/PluginWidgetAndroid.cpp
+++ b/WebKit/android/plugins/PluginWidgetAndroid.cpp
@@ -271,14 +271,8 @@ void PluginWidgetAndroid::updateEventFlags(ANPEventFlags flags) {
Document* doc = m_pluginView->getParentFrame()->document();
#if ENABLE(TOUCH_EVENTS)
if((m_eventFlags ^ flags) & kTouch_ANPEventFlag) {
- if (flags & kTouch_ANPEventFlag) {
- if (Page* page = doc->page())
- page->chrome()->client()->needTouchEvents(true, false);
- doc->addListenerTypeIfNeeded(eventNames().touchstartEvent);
- } else {
- if (Page* page = doc->page())
- page->chrome()->client()->needTouchEvents(false, false);
- }
+ if (flags & kTouch_ANPEventFlag)
+ doc->addListenerTypeIfNeeded(eventNames().touchstartEvent);
}
#endif