diff options
-rw-r--r-- | WebCore/platform/ScrollView.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/android/ScrollViewAndroid.cpp | 11 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 11 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 5 |
4 files changed, 27 insertions, 2 deletions
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp index 1e28651..69ecac2 100644 --- a/WebCore/platform/ScrollView.cpp +++ b/WebCore/platform/ScrollView.cpp @@ -985,11 +985,11 @@ void ScrollView::platformSetScrollbarsSuppressed(bool) #if !PLATFORM(MAC) && !PLATFORM(WX) +#if !PLATFORM(ANDROID) void ScrollView::platformSetScrollbarModes() { } -#if !PLATFORM(ANDROID) void ScrollView::platformScrollbarModes(ScrollbarMode& horizontal, ScrollbarMode& vertical) const { horizontal = ScrollbarAuto; diff --git a/WebCore/platform/android/ScrollViewAndroid.cpp b/WebCore/platform/android/ScrollViewAndroid.cpp index db20591..90a988d 100644 --- a/WebCore/platform/android/ScrollViewAndroid.cpp +++ b/WebCore/platform/android/ScrollViewAndroid.cpp @@ -73,9 +73,18 @@ void ScrollView::platformSetScrollPosition(const WebCore::IntPoint& pt) android::WebViewCore::getWebViewCore(this)->scrollTo(pt.x(), pt.y()); } +void ScrollView::platformSetScrollbarModes() +{ + if (parent()) // no scrollbar for the subframes + return; + android::WebViewCore::getWebViewCore(this)->setScrollbarModes(m_horizontalScrollbarMode, m_verticalScrollbarMode); +} + void ScrollView::platformScrollbarModes(ScrollbarMode& h, ScrollbarMode& v) const { - h = v = ScrollbarAlwaysOff; + // m_horizontalScrollbarMode and m_verticalScrollbarMode are set in ScrollView::setScrollbarModes() + h = m_horizontalScrollbarMode; + v = m_verticalScrollbarMode; } bool ScrollView::platformProhibitsScrolling() diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 5a0c471..14fd44e 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -252,6 +252,7 @@ struct WebViewCore::JavaGlue { jmethodID m_sendFindAgain; jmethodID m_showRect; jmethodID m_centerFitRect; + jmethodID m_setScrollbarModes; AutoJObject object(JNIEnv* env) { return getRealObject(env, m_obj); } @@ -342,6 +343,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_sendFindAgain = GetJMethod(env, clazz, "sendFindAgain", "()V"); m_javaGlue->m_showRect = GetJMethod(env, clazz, "showRect", "(IIIIIIFFFF)V"); m_javaGlue->m_centerFitRect = GetJMethod(env, clazz, "centerFitRect", "(IIII)V"); + m_javaGlue->m_setScrollbarModes = GetJMethod(env, clazz, "setScrollbarModes", "(II)V"); env->SetIntField(javaWebViewCore, gWebViewCoreFields.m_nativeClass, (jint)this); @@ -2523,6 +2525,15 @@ void WebViewCore::centerFitRect(int x, int y, int width, int height) checkException(env); } + +void WebViewCore::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode) +{ + JNIEnv* env = JSC::Bindings::getJNIEnv(); + env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_setScrollbarModes, + horizontalMode, verticalMode); + checkException(env); +} + //---------------------------------------------------------------------- // Native JNI methods //---------------------------------------------------------------------- diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 4a4b335..4ed17bf 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -249,6 +249,11 @@ namespace android { void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID, int msgLevel); + /** + * Tell the Java side of the scrollbar mode + */ + void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode); + // // Followings support calls from Java to native WebCore // |