mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1362195 - 3. Call onFullScreen for full screen changes; r=snorp
Send an event from nsWindow to GeckoView when we enter/exit full screen mode, and call ContentListener.onFullScreen to notify the implementer.
This commit is contained in:
parent
1137640d64
commit
044b6b9b8c
@ -16,6 +16,7 @@ import org.mozilla.gecko.annotation.ReflectionTarget;
|
||||
import org.mozilla.gecko.annotation.WrapForJNI;
|
||||
import org.mozilla.gecko.gfx.LayerView;
|
||||
import org.mozilla.gecko.mozglue.JNIObject;
|
||||
import org.mozilla.gecko.util.ActivityUtils;
|
||||
import org.mozilla.gecko.util.BundleEventListener;
|
||||
import org.mozilla.gecko.util.EventCallback;
|
||||
import org.mozilla.gecko.util.GeckoBundle;
|
||||
@ -196,6 +197,8 @@ public class GeckoView extends LayerView
|
||||
/* package */ void registerListeners() {
|
||||
getEventDispatcher().registerUiThreadListener(this,
|
||||
"GeckoView:DOMTitleChanged",
|
||||
"GeckoView:FullScreenEnter",
|
||||
"GeckoView:FullScreenExit",
|
||||
"GeckoView:LocationChange",
|
||||
"GeckoView:PageStart",
|
||||
"GeckoView:PageStop",
|
||||
@ -215,6 +218,14 @@ public class GeckoView extends LayerView
|
||||
if (mContentListener != null) {
|
||||
mContentListener.onTitleChange(GeckoView.this, message.getString("title"));
|
||||
}
|
||||
} else if ("GeckoView:FullScreenEnter".equals(event)) {
|
||||
if (mContentListener != null) {
|
||||
mContentListener.onFullScreen(GeckoView.this, true);
|
||||
}
|
||||
} else if ("GeckoView:FullScreenExit".equals(event)) {
|
||||
if (mContentListener != null) {
|
||||
mContentListener.onFullScreen(GeckoView.this, false);
|
||||
}
|
||||
} else if ("GeckoView:LocationChange".equals(event)) {
|
||||
if (mNavigationListener == null) {
|
||||
// We shouldn't be getting this event.
|
||||
|
@ -1920,9 +1920,14 @@ nsWindow::DispatchEvent(WidgetGUIEvent* aEvent)
|
||||
nsresult
|
||||
nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen*)
|
||||
{
|
||||
if (!mAndroidView) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
mIsFullScreen = aFullScreen;
|
||||
mAwaitingFullScreen = true;
|
||||
GeckoAppShell::SetFullScreen(aFullScreen);
|
||||
mAndroidView->mEventDispatcher->Dispatch(aFullScreen ?
|
||||
u"GeckoView:FullScreenEnter" : u"GeckoView:FullScreenExit");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user