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

Unified Diff: chrome/browser/ui/views/fullscreen_exit_bubble.cc

Issue 7031053: Make Widget ownership a little clearer by expressing it in terms of an enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « chrome/browser/ui/views/dropdown_bar_host.cc ('k') | chrome/browser/ui/views/status_bubble_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/fullscreen_exit_bubble.cc
===================================================================
--- chrome/browser/ui/views/fullscreen_exit_bubble.cc (revision 86623)
+++ chrome/browser/ui/views/fullscreen_exit_bubble.cc (working copy)
@@ -133,7 +133,7 @@
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.transparent = true;
params.can_activate = false;
- params.delete_on_destroy = false;
+ params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.parent = frame->GetNativeView();
params.bounds = GetPopupRect(false);
popup_->Init(params);
@@ -154,14 +154,14 @@
FullscreenExitBubble::~FullscreenExitBubble() {
// This is tricky. We may be in an ATL message handler stack, in which case
- // the popup cannot be deleted yet. We also can't blindly use
- // set_delete_on_destroy(true) on the popup to delete it when it closes,
- // because if the user closed the last tab while in fullscreen mode, Windows
- // has already destroyed the popup HWND by the time we get here, and thus
- // either the popup will already have been deleted (if we set this in our
- // constructor) or the popup will never get another OnFinalMessage() call (if
- // not, as currently). So instead, we tell the popup to synchronously hide,
- // and then asynchronously close and delete itself.
+ // the popup cannot be deleted yet. We also can't set the popup's ownership
+ // model to NATIVE_WIDGET_OWNS_WIDGET because if the user closed the last tab
+ // while in fullscreen mode, Windows has already destroyed the popup HWND by
+ // the time we get here, and thus either the popup will already have been
+ // deleted (if we set this in our constructor) or the popup will never get
+ // another OnFinalMessage() call (if not, as currently). So instead, we tell
+ // the popup to synchronously hide, and then asynchronously close and delete
+ // itself.
popup_->Close();
MessageLoop::current()->DeleteSoon(FROM_HERE, popup_);
}
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host.cc ('k') | chrome/browser/ui/views/status_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698