Bug 727421 - Implement full screen support for Flash on Android r=blassey

This commit is contained in:
James Willcox
2012-05-30 10:29:16 -04:00
parent dcbe9c3d1d
commit 7fc5d98cea
15 changed files with 297 additions and 91 deletions

View File

@@ -136,7 +136,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
jEnableBatteryNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableBatteryNotifications", "()V");
jDisableBatteryNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "disableBatteryNotifications", "()V");
jGetCurrentBatteryInformation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getCurrentBatteryInformation", "()[D");
jRemovePluginView = jEnv->GetStaticMethodID(jGeckoAppShellClass, "removePluginView", "(Landroid/view/View;)V");
jRemovePluginView = jEnv->GetStaticMethodID(jGeckoAppShellClass, "removePluginView", "(Landroid/view/View;Z)V");
jNotifyPaintedRect = jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyPaintedRect", "(FFFF)V");
jHandleGeckoMessage = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "handleGeckoMessage", "(Ljava/lang/String;)Ljava/lang/String;");
@@ -185,7 +185,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
#ifdef MOZ_JAVA_COMPOSITOR
jPumpMessageLoop = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "pumpMessageLoop", "()V");
jAddPluginView = jEnv->GetStaticMethodID(jGeckoAppShellClass, "addPluginView", "(Landroid/view/View;IIII)V");
jAddPluginView = jEnv->GetStaticMethodID(jGeckoAppShellClass, "addPluginView", "(Landroid/view/View;IIIIZI)V");
jCreateSurface = jEnv->GetStaticMethodID(jGeckoAppShellClass, "createSurface", "()Landroid/view/Surface;");
jShowSurface = jEnv->GetStaticMethodID(jGeckoAppShellClass, "showSurface", "(Landroid/view/Surface;IIIIZZ)V");
jHideSurface = jEnv->GetStaticMethodID(jGeckoAppShellClass, "hideSurface", "(Landroid/view/Surface;)V");
@@ -2310,7 +2310,7 @@ NS_IMETHODIMP nsAndroidBridge::SetBrowserApp(nsIAndroidBrowserApp *aBrowserApp)
}
void
AndroidBridge::AddPluginView(jobject view, const gfxRect& rect) {
AndroidBridge::AddPluginView(jobject view, const gfxRect& rect, bool isFullScreen, int orientation) {
JNIEnv *env = GetJNIEnv();
if (!env)
return;
@@ -2320,7 +2320,8 @@ AndroidBridge::AddPluginView(jobject view, const gfxRect& rect) {
#if MOZ_JAVA_COMPOSITOR
env->CallStaticVoidMethod(sBridge->mGeckoAppShellClass,
sBridge->jAddPluginView, view,
(int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
(int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height,
isFullScreen, orientation);
#else
env->CallStaticVoidMethod(sBridge->mGeckoAppShellClass,
sBridge->jAddPluginView, view,
@@ -2329,14 +2330,14 @@ AndroidBridge::AddPluginView(jobject view, const gfxRect& rect) {
}
void
AndroidBridge::RemovePluginView(jobject view)
AndroidBridge::RemovePluginView(jobject view, bool isFullScreen)
{
JNIEnv *env = GetJNIEnv();
if (!env)
return;
AutoLocalJNIFrame jniFrame(env, 0);
env->CallStaticVoidMethod(mGeckoAppShellClass, jRemovePluginView, view);
env->CallStaticVoidMethod(mGeckoAppShellClass, jRemovePluginView, view, isFullScreen);
}
extern "C"