chrome: Standardize fullscreen transition behavor/callbacks (fixes #3571)

Use the same code path for all fullscreen transitions so that Chrome UI updates
correctly. All user-initiated fullscreen transitions now result in
CefWindowDelegate::OnWindowFullscreenTransition callbacks.
This commit is contained in:
Marshall Greenblatt
2023-09-25 15:40:17 -04:00
parent 262ed72348
commit 39e64d8cc9
33 changed files with 521 additions and 195 deletions

View File

@@ -7,6 +7,7 @@
#include "include/views/cef_window.h"
#include "include/views/cef_window_delegate.h"
#include "libcef/browser/views/ns_window.h"
#include "libcef/browser/views/window_impl.h"
#include "chrome/browser/apps/app_shim/app_shim_host_mac.h"
#include "chrome/browser/apps/app_shim/app_shim_manager_mac.h"
@@ -118,12 +119,16 @@ void CefNativeWidgetMac::GetWindowFrameTitlebarHeight(
void CefNativeWidgetMac::OnWindowFullscreenTransitionStart() {
views::NativeWidgetMac::OnWindowFullscreenTransitionStart();
window_delegate_->OnWindowFullscreenTransition(window_, false);
if (IsCefWindowInitialized()) {
window_delegate_->OnWindowFullscreenTransition(window_, false);
}
}
void CefNativeWidgetMac::OnWindowFullscreenTransitionComplete() {
views::NativeWidgetMac::OnWindowFullscreenTransitionComplete();
window_delegate_->OnWindowFullscreenTransition(window_, true);
if (IsCefWindowInitialized()) {
window_delegate_->OnWindowFullscreenTransition(window_, true);
}
}
void CefNativeWidgetMac::OnWindowInitialized() {
@@ -142,3 +147,7 @@ void CefNativeWidgetMac::OnWindowInitialized() {
}
}
}
bool CefNativeWidgetMac::IsCefWindowInitialized() const {
return static_cast<CefWindowImpl*>(window_.get())->initialized();
}