blink::WebFullscreenOptions
This commit is contained in:
Родитель
a5b09e25ea
Коммит
517d38f191
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -229,6 +229,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
// 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<WebContents>,
|
|||
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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче