diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index d80c8dc4b9..c72ec88acc 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -642,21 +642,25 @@ content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent( return content::KeyboardEventProcessingResult::NOT_HANDLED; } -void WebContents::EnterFullscreenModeForTab(content::WebContents* source, - const GURL& origin) { +void WebContents::EnterFullscreenModeForTab( + content::WebContents* source, + const GURL& origin, + const blink::WebFullscreenOptions& options) { auto* permission_helper = WebContentsPermissionHelper::FromWebContents(source); auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab, - base::Unretained(this), source, origin); + base::Unretained(this), source, origin, options); permission_helper->RequestFullscreenPermission(callback); } -void WebContents::OnEnterFullscreenModeForTab(content::WebContents* source, - const GURL& origin, - bool allowed) { +void WebContents::OnEnterFullscreenModeForTab( + content::WebContents* source, + const GURL& origin, + const blink::WebFullscreenOptions& options, + bool allowed) { if (!allowed) return; - CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin); + CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin, options); Emit("enter-html-full-screen"); } diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 0233a6305e..034dc01545 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -229,6 +229,7 @@ class WebContents : public mate::TrackableObject, // Callback triggered on permission response. void OnEnterFullscreenModeForTab(content::WebContents* source, const GURL& origin, + const blink::WebFullscreenOptions& options, bool allowed); // Create window with the given disposition. @@ -323,8 +324,10 @@ class WebContents : public mate::TrackableObject, content::KeyboardEventProcessingResult PreHandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; - void EnterFullscreenModeForTab(content::WebContents* source, - const GURL& origin) override; + void EnterFullscreenModeForTab( + content::WebContents* source, + const GURL& origin, + const blink::WebFullscreenOptions& options) override; void ExitFullscreenModeForTab(content::WebContents* source) override; void RendererUnresponsive( content::WebContents* source, diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index de8a4f251b..ddbadc658f 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -270,7 +270,8 @@ void CommonWebContentsDelegate::EnumerateDirectory(content::WebContents* guest, void CommonWebContentsDelegate::EnterFullscreenModeForTab( content::WebContents* source, - const GURL& origin) { + const GURL& origin, + const blink::WebFullscreenOptions& options) { if (!owner_window_) return; SetHtmlApiFullscreen(true); diff --git a/atom/browser/common_web_contents_delegate.h b/atom/browser/common_web_contents_delegate.h index 1111b061b5..31062e6dec 100644 --- a/atom/browser/common_web_contents_delegate.h +++ b/atom/browser/common_web_contents_delegate.h @@ -80,8 +80,10 @@ class CommonWebContentsDelegate void EnumerateDirectory(content::WebContents* web_contents, int request_id, const base::FilePath& path) override; - void EnterFullscreenModeForTab(content::WebContents* source, - const GURL& origin) override; + void EnterFullscreenModeForTab( + content::WebContents* source, + const GURL& origin, + const blink::WebFullscreenOptions& options) override; void ExitFullscreenModeForTab(content::WebContents* source) override; bool IsFullscreenForTabOrPending( const content::WebContents* source) const override;