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

Unified Diff: views/widget/native_widget_win.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 | « views/widget/native_widget_win.h ('k') | views/widget/native_widget_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_win.cc
===================================================================
--- views/widget/native_widget_win.cc (revision 86623)
+++ views/widget/native_widget_win.cc (working copy)
@@ -139,7 +139,7 @@
use_layered_buffer_(false),
layered_alpha_(255),
ALLOW_THIS_IN_INITIALIZER_LIST(paint_layered_window_factory_(this)),
- delete_on_destroy_(true),
+ ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET),
can_update_layered_window_(true),
is_window_(false),
restore_focus_when_enabled_(false),
@@ -153,7 +153,7 @@
// We need to delete the input method before calling DestroyRootView(),
// because it'll set focus_manager_ to NULL.
input_method_.reset();
- if (delete_on_destroy_)
+ if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET)
delete delegate_;
}
@@ -954,7 +954,7 @@
}
void NativeWidgetWin::OnFinalMessage(HWND window) {
- if (delete_on_destroy_)
+ if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET)
delete this;
}
@@ -1048,7 +1048,7 @@
void NativeWidgetWin::SetInitParams(const Widget::InitParams& params) {
// Set non-style attributes.
- delete_on_destroy_ = params.delete_on_destroy;
+ ownership_ = params.ownership;
DWORD style = WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
DWORD ex_style = 0;
« no previous file with comments | « views/widget/native_widget_win.h ('k') | views/widget/native_widget_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698