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

Unified Diff: views/widget/native_widget_test_utils_win.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | « views/widget/native_widget_test_utils_gtk.cc ('k') | views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_test_utils_win.cc
===================================================================
--- views/widget/native_widget_test_utils_win.cc (revision 83020)
+++ views/widget/native_widget_test_utils_win.cc (working copy)
@@ -15,23 +15,23 @@
}
NativeWidget* CreateNativeWidgetWithContents(View* contents_view) {
- WidgetWin* widget = new WidgetWin;
+ Widget* widget = Widget::CreateWidget();
Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW);
params.delete_on_destroy = false;
- widget->SetCreateParams(params);
- widget->Init(NULL, gfx::Rect(10, 10, 200, 200));
- return widget;
+ params.bounds = gfx::Rect(10, 10, 200, 200);
+ widget->Init(params);
+ return widget->native_widget();
}
NativeWidget* CreateNativeWidgetWithParent(NativeWidget* parent) {
- WidgetWin* widget = new WidgetWin;
+ Widget* widget = Widget::CreateWidget();
Widget::CreateParams params(Widget::CreateParams::TYPE_CONTROL);
params.delete_on_destroy = false;
params.child = false; // Implicitly set to true by ctor with TYPE_CONTROL.
- widget->SetCreateParams(params);
- widget->Init(parent ? parent->GetWidget()->GetNativeView() : NULL,
- gfx::Rect(10, 10, 200, 200));
- return widget;
+ params.parent = parent ? parent->GetWidget()->GetNativeView() : NULL;
+ params.bounds = gfx::Rect(10, 10, 200, 200);
+ widget->Init(params);
+ return widget->native_widget();
}
} // namespace internal
« no previous file with comments | « views/widget/native_widget_test_utils_gtk.cc ('k') | views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698