fix: DCHECK entering fullscreen while loading url (#35111)

* fix: DCHECK entering fullscreen while loading url

* spec: fixup test
This commit is contained in:
Shelley Vohr 2022-08-01 22:52:58 +02:00 committed by GitHub
parent 6c17dd2296
commit 7588bb7425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 9 deletions

View file

@ -1327,6 +1327,8 @@ void WebContents::OnEnterFullscreenModeForTab(
return;
}
owner_window()->set_fullscreen_transition_type(
NativeWindow::FullScreenTransitionType::HTML);
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id);
@ -3537,12 +3539,15 @@ void WebContents::EnumerateDirectory(
bool WebContents::IsFullscreenForTabOrPending(
const content::WebContents* source) {
bool transition_fs = owner_window()
? owner_window()->fullscreen_transition_state() !=
NativeWindow::FullScreenTransitionState::NONE
: false;
if (!owner_window())
return html_fullscreen_;
return html_fullscreen_ || transition_fs;
bool in_transition = owner_window()->fullscreen_transition_state() !=
NativeWindow::FullScreenTransitionState::NONE;
bool is_html_transition = owner_window()->fullscreen_transition_type() ==
NativeWindow::FullScreenTransitionType::HTML;
return html_fullscreen_ || (in_transition && is_html_transition);
}
bool WebContents::TakeFocus(content::WebContents* source, bool reverse) {