fix: HTML fullscreen request for sub frames (#18736)

Don't re-enter fullscreen if there is a pending operation,
for subframe fullscreen request `EnterFullScreenModeForTab`
will be called for both the frame in question as well as
the outer webContents hosting it.
This commit is contained in:
Robo 2019-06-13 14:02:56 -07:00 committed by Shelley Vohr
parent 9856e5df3b
commit 5e320291b4
4 changed files with 16 additions and 2 deletions

View file

@ -326,9 +326,12 @@ void CommonWebContentsDelegate::EnterFullscreenModeForTab(
const blink::WebFullscreenOptions& options) {
if (!owner_window_)
return;
if (IsFullscreenForTabOrPending(source)) {
DCHECK_EQ(fullscreen_frame_, source->GetFocusedFrame());
return;
}
SetHtmlApiFullscreen(true);
owner_window_->NotifyWindowEnterHtmlFullScreen();
source->GetRenderViewHost()->GetWidget()->SynchronizeVisualProperties();
}
void CommonWebContentsDelegate::ExitFullscreenModeForTab(
@ -337,7 +340,6 @@ void CommonWebContentsDelegate::ExitFullscreenModeForTab(
return;
SetHtmlApiFullscreen(false);
owner_window_->NotifyWindowLeaveHtmlFullScreen();
source->GetRenderViewHost()->GetWidget()->SynchronizeVisualProperties();
}
bool CommonWebContentsDelegate::IsFullscreenForTabOrPending(