Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: ui/views/widget/widget.cc

Issue 2834943002: Don't allow a widget to send close notifications more than once. (Closed)
Patch Set: dont touch that one Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/widget/widget_unittest.cc » ('j') | ui/views/widget/widget_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index de3ac38f969274531808a3cbb822f406c27cf62d..aa128e585040ec6fc7c9000630f55aa50d059e8e 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -585,6 +585,9 @@ void Widget::Close() {
if (non_client_view_)
can_close = non_client_view_->CanClose();
sky 2017/04/25 05:04:10 While you're here simplify this to an early return
Evan Stade 2017/04/25 22:52:51 Done.
if (can_close) {
+ // 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
@@ -599,7 +602,6 @@ void Widget::Close() {
observer.OnWidgetClosing(this);
native_widget_->Close();
- widget_closed_ = true;
}
}
« no previous file with comments | « no previous file | ui/views/widget/widget_unittest.cc » ('j') | ui/views/widget/widget_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698