mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
osr: linux: Fix crash with default JS modal dialogs (fixes #3921)
This commit is contained in:
@ -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',
|
||||
},
|
||||
{
|
||||
|
@ -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<views::BubbleFrameView*>(
|
||||
- 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<views::BubbleFrameView*>(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)) {
|
||||
|
Reference in New Issue
Block a user