diff options
| -rw-r--r-- | WebKit/Android.mk | 1 | ||||
| -rw-r--r-- | WebKit/android/jni/WebCoreJniOnLoad.cpp | 2 | ||||
| -rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 8 | ||||
| -rw-r--r-- | WebKit/android/jni/WebViewCore.h | 2 | ||||
| -rw-r--r-- | WebKit/android/plugins/ANPWindowInterface.cpp | 3 | ||||
| -rw-r--r-- | WebKit/android/plugins/PluginWidgetAndroid.cpp | 10 | ||||
| -rw-r--r-- | WebKit/android/plugins/PluginWidgetAndroid.h | 10 |
7 files changed, 14 insertions, 22 deletions
diff --git a/WebKit/Android.mk b/WebKit/Android.mk index 07d030b..ac43360 100644 --- a/WebKit/Android.mk +++ b/WebKit/Android.mk @@ -42,6 +42,7 @@ LOCAL_SRC_FILES := \ android/jni/JavaSharedClient.cpp \ android/jni/MockGeolocation.cpp \ android/jni/PictureSet.cpp \ + android/jni/PluginActivity.cpp \ android/jni/WebCoreFrameBridge.cpp \ android/jni/WebCoreJni.cpp \ android/jni/WebCoreResourceLoader.cpp \ diff --git a/WebKit/android/jni/WebCoreJniOnLoad.cpp b/WebKit/android/jni/WebCoreJniOnLoad.cpp index 616526b..6711e6b 100644 --- a/WebKit/android/jni/WebCoreJniOnLoad.cpp +++ b/WebKit/android/jni/WebCoreJniOnLoad.cpp @@ -88,6 +88,7 @@ extern int register_mock_geolocation(JNIEnv*); #if ENABLE(VIDEO) extern int register_mediaplayer(JNIEnv*); #endif +extern int register_plugin_activity(JNIEnv*); } @@ -114,6 +115,7 @@ static RegistrationMethod gWebCoreRegMethods[] = { #if ENABLE(VIDEO) { "HTML5VideoViewProxy", android::register_mediaplayer }, #endif + { "PluginActivity", android::register_plugin_activity }, }; EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 2684c52..bc650ad 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -271,7 +271,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_addMessageToConsole = GetJMethod(env, clazz, "addMessageToConsole", "(Ljava/lang/String;ILjava/lang/String;)V"); m_javaGlue->m_getPluginClass = GetJMethod(env, clazz, "getPluginClass", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class;"); m_javaGlue->m_createPluginJavaInstance = GetJMethod(env, clazz, "createPluginJavaInstance", "(Ljava/lang/String;I)Landroid/webkit/plugin/WebkitPlugin;"); - m_javaGlue->m_startFullScreenPluginActivity = GetJMethod(env, clazz, "startFullScreenPluginActivity", "(Ljava/lang/String;I)V"); + m_javaGlue->m_startFullScreenPluginActivity = GetJMethod(env, clazz, "startFullScreenPluginActivity", "(I)V"); m_javaGlue->m_createSurface = GetJMethod(env, clazz, "createSurface", "(Landroid/webkit/plugin/WebkitPlugin;IIII)Landroid/webkit/ViewManager$ChildView;"); m_javaGlue->m_updateSurface = GetJMethod(env, clazz, "updateSurface", "(Landroid/webkit/ViewManager$ChildView;IIII)V"); m_javaGlue->m_destroySurface = GetJMethod(env, clazz, "destroySurface", "(Landroid/webkit/ViewManager$ChildView;)V"); @@ -2480,7 +2480,7 @@ jobject WebViewCore::createPluginJavaInstance(const WebCore::String& libName, NP return result; } -void WebViewCore::startFullScreenPluginActivity(const char* libName, NPP npp) +void WebViewCore::startFullScreenPluginActivity(NPP npp) { JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject obj = m_javaGlue->object(env); @@ -2489,10 +2489,8 @@ void WebViewCore::startFullScreenPluginActivity(const char* libName, NPP npp) if (!obj.get()) return; - jstring libString = env->NewStringUTF(libName); env->CallVoidMethod(obj.get(), - m_javaGlue->m_startFullScreenPluginActivity, - libString, (int) npp); + m_javaGlue->m_startFullScreenPluginActivity, (int) npp); checkException(env); } diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 19bca96..8a0df23 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -377,7 +377,7 @@ namespace android { jobject createPluginJavaInstance(const WebCore::String& libName, NPP npp); // Creates a full screen surface (i.e. View on an Activity) for a plugin - void startFullScreenPluginActivity(const char* libName, NPP npp); + void startFullScreenPluginActivity(NPP npp); // Creates a Surface (i.e. View) for a plugin jobject createSurface(jobject webkitPlugin, int x, int y, int width, int height); diff --git a/WebKit/android/plugins/ANPWindowInterface.cpp b/WebKit/android/plugins/ANPWindowInterface.cpp index b35dfd3..543332d 100644 --- a/WebKit/android/plugins/ANPWindowInterface.cpp +++ b/WebKit/android/plugins/ANPWindowInterface.cpp @@ -54,7 +54,8 @@ static void anp_showKeyboard(NPP instance, bool value) { static void anp_requestFullScreen(NPP instance) { PluginView* pluginView = pluginViewForInstance(instance); - pluginView->platformPluginWidget()->requestFullScreenMode(); + PluginWidgetAndroid* pluginWidget = pluginView->platformPluginWidget(); + pluginWidget->webViewCore()->startFullScreenPluginActivity(instance); } /////////////////////////////////////////////////////////////////////////////// diff --git a/WebKit/android/plugins/PluginWidgetAndroid.cpp b/WebKit/android/plugins/PluginWidgetAndroid.cpp index 9c8d25d..36d7420 100644 --- a/WebKit/android/plugins/PluginWidgetAndroid.cpp +++ b/WebKit/android/plugins/PluginWidgetAndroid.cpp @@ -141,16 +141,6 @@ void PluginWidgetAndroid::setWindow(NPWindow* window, bool isTransparent) { } } -void PluginWidgetAndroid::requestFullScreenMode() { - - const String& libName = m_pluginView->plugin()->path(); - SkString skLibName; - skLibName.setUTF16(libName.characters(), libName.length()); - - m_core->startFullScreenPluginActivity(skLibName.c_str(), - m_pluginView->instance()); -} - bool PluginWidgetAndroid::setDrawingModel(ANPDrawingModel model) { m_drawingModel = model; return true; diff --git a/WebKit/android/plugins/PluginWidgetAndroid.h b/WebKit/android/plugins/PluginWidgetAndroid.h index da2291f..24ef69b 100644 --- a/WebKit/android/plugins/PluginWidgetAndroid.h +++ b/WebKit/android/plugins/PluginWidgetAndroid.h @@ -125,17 +125,17 @@ struct PluginWidgetAndroid { */ void setVisibleRects(const ANPRectI rects[], int32_t count); - /** Called when a plugin wishes to enter into full screen mode. The plugin's - Java class (set using setPluginStubJavaClassName(...)) will be called - asynchronously to provide a View to be displayed in full screen. + /** Returns a java object that implements the WebkitPlugin interface. The + implementation is located in the plugin's apk and is described in the + apk's manifest file. For each plugin instance in webkit there is at + most one instance of the java object associated with that plugin. */ - void requestFullScreenMode(); + jobject getJavaPluginInstance(); private: WebCore::IntPoint frameToDocumentCoords(int frameX, int frameY) const; void computeVisibleFrameRect(); void scrollToVisibleFrameRect(); - jobject getJavaPluginInstance(); WebCore::PluginView* m_pluginView; android::WebViewCore* m_core; |
