This commit is contained in:
Jeremy Apthorp 2018-09-14 17:17:50 -07:00 коммит произвёл Aleksei Kuzmin
Родитель a5b09e25ea
Коммит 517d38f191
4 изменённых файлов: 22 добавлений и 12 удалений

Просмотреть файл

@ -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;