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

Unified Diff: ui/views/test/child_modal_window.cc

Issue 11795004: Continue threading context through unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « ui/views/test/child_modal_window.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/child_modal_window.cc
diff --git a/ui/views/test/child_modal_window.cc b/ui/views/test/child_modal_window.cc
index b3e072af4ea39fea22a18c7dc18c002dae142a95..ebf1ac2662d6834ad878920fed914dcaa2091e78 100644
--- a/ui/views/test/child_modal_window.cc
+++ b/ui/views/test/child_modal_window.cc
@@ -45,9 +45,10 @@ const SkColor kChildColor = SK_ColorWHITE;
} // namespace
-void CreateChildModalParent() {
- Widget::CreateWindowWithBounds(
- new ChildModalParent,
+void CreateChildModalParent(gfx::NativeView context) {
+ Widget::CreateWindowWithContextAndBounds(
+ new ChildModalParent(context),
+ context,
gfx::Rect(kWindowLeft, kWindowTop, kWindowWidth, kWindowHeight))->Show();
}
@@ -106,7 +107,7 @@ ui::ModalType ChildModalWindow::GetModalType() const {
return ui::MODAL_TYPE_CHILD;
}
-ChildModalParent::ChildModalParent()
+ChildModalParent::ChildModalParent(gfx::NativeView context)
: ALLOW_THIS_IN_INITIALIZER_LIST(button_(new NativeTextButton(
this, ASCIIToUTF16("Show/Hide Child Modal Window")))),
textfield_(new Textfield),
@@ -114,7 +115,9 @@ ChildModalParent::ChildModalParent()
modal_parent_(NULL),
child_(NULL) {
Widget* widget = new Widget;
- widget->Init(Widget::InitParams(Widget::InitParams::TYPE_CONTROL));
+ Widget::InitParams params(Widget::InitParams::TYPE_CONTROL);
+ params.context = context;
+ widget->Init(params);
widget->GetRootView()->set_background(
Background::CreateSolidBackground(kModalParentColor));
modal_parent_ = widget->GetNativeView();
« no previous file with comments | « ui/views/test/child_modal_window.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698