summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-08-18 10:08:49 -0700
committerGrace Kloba <klobag@google.com>2009-08-18 10:08:49 -0700
commit29efdb685ae2c3da761273415d2f7df07852e463 (patch)
tree435fb663ceb32a3f37a4e6d59bc762d4ca32f914 /WebKit
parent8bba87309bc6171f066820ce64c7e73b725a94e1 (diff)
downloadexternal_webkit-29efdb685ae2c3da761273415d2f7df07852e463.zip
external_webkit-29efdb685ae2c3da761273415d2f7df07852e463.tar.gz
external_webkit-29efdb685ae2c3da761273415d2f7df07852e463.tar.bz2
Need to notify Java side when viewport tag is parsed.
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp12
-rw-r--r--WebKit/android/jni/WebViewCore.h5
2 files changed, 17 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index aa96b18..88a00b1 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -168,6 +168,7 @@ struct WebViewCore::JavaGlue {
jmethodID m_jsUnload;
jmethodID m_jsInterrupt;
jmethodID m_didFirstLayout;
+ jmethodID m_updateViewport;
jmethodID m_sendNotifyProgressFinished;
jmethodID m_sendViewInvalidate;
jmethodID m_updateTextfield;
@@ -242,6 +243,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
m_javaGlue->m_jsUnload = GetJMethod(env, clazz, "jsUnload", "(Ljava/lang/String;Ljava/lang/String;)Z");
m_javaGlue->m_jsInterrupt = GetJMethod(env, clazz, "jsInterrupt", "()Z");
m_javaGlue->m_didFirstLayout = GetJMethod(env, clazz, "didFirstLayout", "(Z)V");
+ m_javaGlue->m_updateViewport = GetJMethod(env, clazz, "updateViewport", "()V");
m_javaGlue->m_sendNotifyProgressFinished = GetJMethod(env, clazz, "sendNotifyProgressFinished", "()V");
m_javaGlue->m_sendViewInvalidate = GetJMethod(env, clazz, "sendViewInvalidate", "(IIII)V");
m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(IZLjava/lang/String;I)V");
@@ -839,6 +841,16 @@ void WebViewCore::didFirstLayout()
m_history.setDidFirstLayout(true);
}
+void WebViewCore::updateViewport()
+{
+ DEBUG_NAV_UI_LOGD("%s", __FUNCTION__);
+ LOG_ASSERT(m_javaGlue->m_obj, "A Java widget was not associated with this view bridge!");
+
+ JNIEnv* env = JSC::Bindings::getJNIEnv();
+ env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_updateViewport);
+ checkException(env);
+}
+
void WebViewCore::restoreScale(int scale)
{
DEBUG_NAV_UI_LOGD("%s", __FUNCTION__);
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index 1408cb7..97018f0 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -152,6 +152,11 @@ namespace android {
void didFirstLayout();
/**
+ * Notify the view to update the viewport.
+ */
+ void updateViewport();
+
+ /**
* Notify the view to restore the screen width, which in turn restores
* the scale.
*/