Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js

Issue 984963004: <webview>: Implement fullscreen permission for html5 element.requestFullscreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tmptmptmp
Patch Set: Disable one test one test on mac with bug ref, use document.webkitIsFullScreen Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js
diff --git a/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js b/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js
index 21cc7b1723244282ef42c9d6650985fe9ba4a4b2..211cdba6ed0a9c7ba0b3123e0ecbf8c74b5e0db3 100644
--- a/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js
+++ b/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js
@@ -14,7 +14,8 @@ var PERMISSION_TYPES = ['media',
'pointerLock',
'download',
'loadplugin',
- 'filesystem'];
+ 'filesystem',
+ 'fullscreen'];
// -----------------------------------------------------------------------------
// WebViewActionRequest object.
@@ -250,11 +251,38 @@ PermissionRequest.prototype.WARNING_MSG_REQUEST_BLOCKED =
// -----------------------------------------------------------------------------
+// FullscreenPermissionRequest object.
+
+// Represents a fullscreen permission request.
+function FullscreenPermissionRequest(webViewImpl, event, webViewEvent) {
+ PermissionRequest.call(this, webViewImpl, event, webViewEvent);
+}
+
+FullscreenPermissionRequest.prototype.__proto__ = PermissionRequest.prototype;
+
+FullscreenPermissionRequest.prototype.getInterfaceObject = function() {
+ return {
+ allow: function() {
+ this.validateCall();
+ WebViewInternal.setPermission(
+ this.guestInstanceId, this.requestId, 'allow');
+ // Now make the <webview> element go fullscreen.
+ this.webViewImpl.makeElementFullscreen();
+ }.bind(this),
+ deny: function() {
+ this.validateCall();
+ WebViewInternal.setPermission(
+ this.guestInstanceId, this.requestId, 'deny');
+ }.bind(this)
+ };
+};
+
var WebViewActionRequests = {
WebViewActionRequest: WebViewActionRequest,
Dialog: Dialog,
NewWindow: NewWindow,
- PermissionRequest: PermissionRequest
+ PermissionRequest: PermissionRequest,
+ FullscreenPermissionRequest: FullscreenPermissionRequest
};
exports.WebViewActionRequests = WebViewActionRequests;

Powered by Google App Engine
This is Rietveld 408576698