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

Unified Diff: views/widget/widget.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/widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget.cc
===================================================================
--- views/widget/widget.cc (revision 86623)
+++ views/widget/widget.cc (working copy)
@@ -33,7 +33,7 @@
accept_events(true),
can_activate(true),
keep_on_top(false),
- delete_on_destroy(true),
+ ownership(NATIVE_WIDGET_OWNS_WIDGET),
mirror_origin_in_rtl(false),
has_dropshadow(false),
double_buffer(false),
@@ -50,7 +50,7 @@
accept_events(true),
can_activate(type != TYPE_POPUP && type != TYPE_MENU),
keep_on_top(type == TYPE_MENU),
- delete_on_destroy(true),
+ ownership(NATIVE_WIDGET_OWNS_WIDGET),
mirror_origin_in_rtl(false),
has_dropshadow(false),
double_buffer(false),
@@ -73,14 +73,14 @@
native_widget_(NULL),
widget_delegate_(NULL),
dragged_view_(NULL),
- delete_on_destroy_(false),
+ ownership_(InitParams::NATIVE_WIDGET_OWNS_WIDGET),
is_secondary_widget_(true) {
}
Widget::~Widget() {
DestroyRootView();
- if (!delete_on_destroy_)
+ if (ownership_ == InitParams::WIDGET_OWNS_NATIVE_WIDGET)
delete native_widget_;
}
@@ -95,7 +95,7 @@
}
void Widget::Init(const InitParams& params) {
- delete_on_destroy_ = params.delete_on_destroy;
+ ownership_ = params.ownership;
native_widget_ =
params.native_widget ? params.native_widget
: NativeWidget::CreateNativeWidget(this);
« no previous file with comments | « views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698