blink::WebFullscreenOptions

This commit is contained in:
Jeremy Apthorp 2018-09-14 17:17:50 -07:00 committed by Aleksei Kuzmin
parent a5b09e25ea
commit 517d38f191
4 changed files with 22 additions and 12 deletions

View file

@ -642,21 +642,25 @@ content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent(
return content::KeyboardEventProcessingResult::NOT_HANDLED; return content::KeyboardEventProcessingResult::NOT_HANDLED;
} }
void WebContents::EnterFullscreenModeForTab(content::WebContents* source, void WebContents::EnterFullscreenModeForTab(
const GURL& origin) { content::WebContents* source,
const GURL& origin,
const blink::WebFullscreenOptions& options) {
auto* permission_helper = auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(source); WebContentsPermissionHelper::FromWebContents(source);
auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab, auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab,
base::Unretained(this), source, origin); base::Unretained(this), source, origin, options);
permission_helper->RequestFullscreenPermission(callback); permission_helper->RequestFullscreenPermission(callback);
} }
void WebContents::OnEnterFullscreenModeForTab(content::WebContents* source, void WebContents::OnEnterFullscreenModeForTab(
const GURL& origin, content::WebContents* source,
bool allowed) { const GURL& origin,
const blink::WebFullscreenOptions& options,
bool allowed) {
if (!allowed) if (!allowed)
return; return;
CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin); CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin, options);
Emit("enter-html-full-screen"); Emit("enter-html-full-screen");
} }

View file

@ -229,6 +229,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Callback triggered on permission response. // Callback triggered on permission response.
void OnEnterFullscreenModeForTab(content::WebContents* source, void OnEnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin, const GURL& origin,
const blink::WebFullscreenOptions& options,
bool allowed); bool allowed);
// Create window with the given disposition. // Create window with the given disposition.
@ -323,8 +324,10 @@ class WebContents : public mate::TrackableObject<WebContents>,
content::KeyboardEventProcessingResult PreHandleKeyboardEvent( content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source, content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override; const content::NativeWebKeyboardEvent& event) override;
void EnterFullscreenModeForTab(content::WebContents* source, void EnterFullscreenModeForTab(
const GURL& origin) override; content::WebContents* source,
const GURL& origin,
const blink::WebFullscreenOptions& options) override;
void ExitFullscreenModeForTab(content::WebContents* source) override; void ExitFullscreenModeForTab(content::WebContents* source) override;
void RendererUnresponsive( void RendererUnresponsive(
content::WebContents* source, content::WebContents* source,

View file

@ -270,7 +270,8 @@ void CommonWebContentsDelegate::EnumerateDirectory(content::WebContents* guest,
void CommonWebContentsDelegate::EnterFullscreenModeForTab( void CommonWebContentsDelegate::EnterFullscreenModeForTab(
content::WebContents* source, content::WebContents* source,
const GURL& origin) { const GURL& origin,
const blink::WebFullscreenOptions& options) {
if (!owner_window_) if (!owner_window_)
return; return;
SetHtmlApiFullscreen(true); SetHtmlApiFullscreen(true);

View file

@ -80,8 +80,10 @@ class CommonWebContentsDelegate
void EnumerateDirectory(content::WebContents* web_contents, void EnumerateDirectory(content::WebContents* web_contents,
int request_id, int request_id,
const base::FilePath& path) override; const base::FilePath& path) override;
void EnterFullscreenModeForTab(content::WebContents* source, void EnterFullscreenModeForTab(
const GURL& origin) override; content::WebContents* source,
const GURL& origin,
const blink::WebFullscreenOptions& options) override;
void ExitFullscreenModeForTab(content::WebContents* source) override; void ExitFullscreenModeForTab(content::WebContents* source) override;
bool IsFullscreenForTabOrPending( bool IsFullscreenForTabOrPending(
const content::WebContents* source) const override; const content::WebContents* source) const override;