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

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

Issue 303543004: MacViews: views_examples_with_content_exe working! Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add files Created 6 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 | « ui/views/examples/examples_window.cc ('k') | ui/views/test/desktop_test_views_delegate.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 fc19ddfd31fab1f4cd1d79bd43a14897d66c05f7..36479824830aaa5df6bfb7d1de2a0aa4b154cc89 100644
--- a/ui/views/test/child_modal_window.cc
+++ b/ui/views/test/child_modal_window.cc
@@ -121,8 +121,10 @@ ChildModalParent::ChildModalParent(gfx::NativeView context)
widget->Init(params);
widget->GetRootView()->set_background(
Background::CreateSolidBackground(kModalParentColor));
- modal_parent_ = widget->GetNativeView();
+ modal_parent_ = widget->GetNativeWindow();
+#if defined(USE_AURA)
widget->GetNativeView()->SetName("ModalParent");
+#endif
AddChildView(button_);
AddChildView(textfield_);
AddChildView(host_);
@@ -143,16 +145,18 @@ gfx::NativeWindow ChildModalParent::GetModalParent() const {
gfx::NativeWindow ChildModalParent::GetChild() const {
if (child_)
- return child_->GetNativeView();
+ return child_->GetNativeWindow();
return NULL;
}
Widget* ChildModalParent::CreateChild() {
Widget* child = Widget::CreateWindowWithParent(
new ChildModalWindow, GetWidget()->GetNativeView());
+#if defined(USE_AURA)
wm::SetModalParent(child->GetNativeView(), GetModalParent());
- child->AddObserver(this);
child->GetNativeView()->SetName("ChildModalWindow");
+#endif
+ child->AddObserver(this);
return child;
}
@@ -190,8 +194,10 @@ void ChildModalParent::Layout() {
void ChildModalParent::ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) {
if (details.is_add && details.child == this) {
+#if defined(USE_AURA)
host_->Attach(modal_parent_);
GetWidget()->GetNativeView()->SetName("Parent");
+#endif
}
}
« no previous file with comments | « ui/views/examples/examples_window.cc ('k') | ui/views/test/desktop_test_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698