diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index f69be2feb605..5e02ef25c60a 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -104,7 +104,8 @@ NativeWindow::NativeWindow(const gin_helper::Dictionary& options, transparent_{options.ValueOrDefault(options::kTransparent, false)}, enable_larger_than_screen_{ options.ValueOrDefault(options::kEnableLargerThanScreen, false)}, - is_modal_{parent != nullptr && options.ValueOrDefault("modal", false)}, + is_modal_{parent != nullptr && + options.ValueOrDefault(options::kModal, false)}, has_frame_{options.ValueOrDefault(options::kFrame, true) && title_bar_style_ == TitleBarStyle::kNormal}, parent_{parent} { diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index e8af8eca8ab0..e027da09fd19 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -555,7 +555,7 @@ bool NativeWindowViews::IsFocused() const { } void NativeWindowViews::Show() { - if (is_modal() && NativeWindow::parent() && !widget()->IsVisible()) + if (is_modal() && NativeWindow::parent()) static_cast(parent())->IncrementChildModals(); widget()->native_widget_private()->Show(GetRestoredState(), gfx::Rect()); diff --git a/shell/common/options_switches.h b/shell/common/options_switches.h index b07313f033ec..9c421f198c5f 100644 --- a/shell/common/options_switches.h +++ b/shell/common/options_switches.h @@ -219,6 +219,8 @@ inline constexpr std::string_view kSpellcheck = "spellcheck"; inline constexpr std::string_view kEnableDeprecatedPaste = "enableDeprecatedPaste"; +inline constexpr std::string_view kModal = "modal"; + } // namespace options // Following are actually command line switches, should be moved to other files.