Bug 1134409 - Make "Full Screen" context-menu command use messages instead of CPOWs. r=mconley.

This commit is contained in:
Ian Moody 2015-02-19 01:39:00 -05:00
parent 72e15b5a25
commit 6ae3764aeb
3 changed files with 5 additions and 7 deletions

View File

@ -156,7 +156,7 @@
<menuitem id="context-video-fullscreen"
accesskey="&videoFullScreen.accesskey;"
label="&videoFullScreen.label;"
oncommand="gContextMenu.fullScreenVideo();"/>
oncommand="gContextMenu.mediaCommand('fullscreen');"/>
<menuitem id="context-leave-dom-fullscreen"
accesskey="&leaveDOMFullScreen.accesskey;"
label="&leaveDOMFullScreen.label;"

View File

@ -1097,5 +1097,9 @@ addMessageListener("ContextMenu:MediaCommand", (message) => {
message.data.command == "showstats");
media.dispatchEvent(event);
break;
case "fullscreen":
if (content.document.mozFullScreenEnabled)
media.mozRequestFullScreen();
break;
}
});

View File

@ -1078,12 +1078,6 @@ nsContextMenu.prototype = {
mm.addMessageListener("ContextMenu:SaveVideoFrameAsImage:Result", onMessage);
},
fullScreenVideo: function () {
let video = this.target;
if (document.mozFullScreenEnabled)
video.mozRequestFullScreen();
},
leaveDOMFullScreen: function() {
document.mozCancelFullScreen();
},