| Index: ui/views/widget/widget.cc
|
| diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
|
| index fbce29ee69aa9f0f31d785434e195aa5e5e9b49d..de3ac38f969274531808a3cbb822f406c27cf62d 100644
|
| --- a/ui/views/widget/widget.cc
|
| +++ b/ui/views/widget/widget.cc
|
| @@ -581,26 +581,26 @@
|
| return;
|
| }
|
|
|
| - if (non_client_view_ && !non_client_view_->CanClose())
|
| - return;
|
| -
|
| - // The actions below can cause this function to be called again, so mark
|
| - // |this| as closed early. See crbug.com/714334
|
| - widget_closed_ = true;
|
| - SaveWindowPlacement();
|
| -
|
| - // During tear-down the top-level focus manager becomes unavailable to
|
| - // GTK tabbed panes and their children, so normal deregistration via
|
| - // |FocusManager::ViewRemoved()| calls are fouled. We clear focus here
|
| - // to avoid these redundant steps and to avoid accessing deleted views
|
| - // that may have been in focus.
|
| - if (is_top_level() && focus_manager_.get())
|
| - focus_manager_->SetFocusedView(nullptr);
|
| -
|
| - for (WidgetObserver& observer : observers_)
|
| - observer.OnWidgetClosing(this);
|
| -
|
| - native_widget_->Close();
|
| + bool can_close = true;
|
| + if (non_client_view_)
|
| + can_close = non_client_view_->CanClose();
|
| + if (can_close) {
|
| + SaveWindowPlacement();
|
| +
|
| + // During tear-down the top-level focus manager becomes unavailable to
|
| + // GTK tabbed panes and their children, so normal deregistration via
|
| + // |FormManager::ViewRemoved()| calls are fouled. We clear focus here
|
| + // to avoid these redundant steps and to avoid accessing deleted views
|
| + // that may have been in focus.
|
| + if (is_top_level() && focus_manager_.get())
|
| + focus_manager_->SetFocusedView(NULL);
|
| +
|
| + for (WidgetObserver& observer : observers_)
|
| + observer.OnWidgetClosing(this);
|
| +
|
| + native_widget_->Close();
|
| + widget_closed_ = true;
|
| + }
|
| }
|
|
|
| void Widget::CloseNow() {
|
|
|