| Index: ui/views/widget/native_widget_mac.mm
|
| diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm
|
| index 8ddf80139c21577cc32d25d36eae81f0bf440151..9f26789a2f15a3048e36d78eeb32a2799a5f996a 100644
|
| --- a/ui/views/widget/native_widget_mac.mm
|
| +++ b/ui/views/widget/native_widget_mac.mm
|
| @@ -96,8 +96,9 @@ BridgedNativeWidget* NativeWidgetMac::GetBridgeForNativeWindow(
|
| }
|
|
|
| bool NativeWidgetMac::IsWindowModalSheet() const {
|
| - return GetWidget()->widget_delegate()->GetModalType() ==
|
| - ui::MODAL_TYPE_WINDOW;
|
| + return bridge_ && bridge_->parent() &&
|
| + GetWidget()->widget_delegate()->GetModalType() ==
|
| + ui::MODAL_TYPE_WINDOW;
|
| }
|
|
|
| void NativeWidgetMac::OnWindowWillClose() {
|
| @@ -292,8 +293,13 @@ void NativeWidgetMac::InitModalType(ui::ModalType modal_type) {
|
|
|
| // System modal windows not implemented (or used) on Mac.
|
| DCHECK_NE(ui::MODAL_TYPE_SYSTEM, modal_type);
|
| - DCHECK(bridge_->parent());
|
| - // Everyhing happens upon show.
|
| +
|
| + // A peculiarity of the constrained window framework is that it permits a
|
| + // dialog of MODAL_TYPE_WINDOW to have a null parent window; falling back to
|
| + // a non-modal window in this case.
|
| + DCHECK(bridge_->parent() || modal_type == ui::MODAL_TYPE_WINDOW);
|
| +
|
| + // Everything happens upon show.
|
| }
|
|
|
| gfx::Rect NativeWidgetMac::GetWindowBoundsInScreen() const {
|
|
|