diff --git a/patch/patch.cfg b/patch/patch.cfg index da7a7d06c..3a8fc7b97 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -270,6 +270,9 @@ patches = [ # Fix usage of JavaScript tab modal dialogs with Alloy style browsers. # Modifies the logic added in https://crrev.com/78ce55cbc0. # https://github.com/chromiumembedded/cef/issues/3818 + # + # Fix crash with OSR browsers on Linux. + # https://github.com/chromiumembedded/cef/issues/3921 'name': 'chrome_browser_dialogs_jsmodal', }, { diff --git a/patch/patches/chrome_browser_dialogs_jsmodal.patch b/patch/patches/chrome_browser_dialogs_jsmodal.patch index 9dd0cd610..07ce74f77 100644 --- a/patch/patches/chrome_browser_dialogs_jsmodal.patch +++ b/patch/patches/chrome_browser_dialogs_jsmodal.patch @@ -57,10 +57,27 @@ index 8c06a19a64e5d..2b9429f7b2bab 100644 } diff --git chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc -index e0c7c6df6f415..171f042d712e4 100644 +index e0c7c6df6f415..106cf8d8b998a 100644 --- chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc +++ chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc -@@ -79,10 +79,13 @@ JavaScriptTabModalDialogViewViews::JavaScriptTabModalDialogViewViews( +@@ -49,9 +49,13 @@ views::View* JavaScriptTabModalDialogViewViews::GetInitiallyFocusedView() { + } + + void JavaScriptTabModalDialogViewViews::AddedToWidget() { +- auto* bubble_frame_view = static_cast( +- GetWidget()->non_client_view()->frame_view()); +- bubble_frame_view->SetTitleView(CreateTitleOriginLabel(GetWindowTitle())); ++ auto* frame_view = GetWidget()->non_client_view()->frame_view(); ++ // With CEF OSR this may be a NativeFrameView, in which case HasWindowTitle() ++ // will return false. ++ if (frame_view->HasWindowTitle()) { ++ auto* bubble_frame_view = static_cast(frame_view); ++ bubble_frame_view->SetTitleView(CreateTitleOriginLabel(GetWindowTitle())); ++ } + if (!message_text_.empty()) { + GetWidget()->GetRootView()->GetViewAccessibility().SetDescription( + message_text_); +@@ -79,10 +83,13 @@ JavaScriptTabModalDialogViewViews::JavaScriptTabModalDialogViewViews( default_prompt_text_(default_prompt_text), dialog_callback_(std::move(dialog_callback)), dialog_force_closed_callback_(std::move(dialog_force_closed_callback)) {