| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/test/child_modal_window.h" | 5 #include "ash/test/child_modal_window.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 gfx::NativeWindow ChildModalParent::GetChild() const { | 142 gfx::NativeWindow ChildModalParent::GetChild() const { |
| 143 if (child_) | 143 if (child_) |
| 144 return child_->GetNativeView(); | 144 return child_->GetNativeView(); |
| 145 return NULL; | 145 return NULL; |
| 146 } | 146 } |
| 147 | 147 |
| 148 Widget* ChildModalParent::CreateChild() { | 148 Widget* ChildModalParent::CreateChild() { |
| 149 Widget* child = Widget::CreateWindowWithParent(new ChildModalWindow, | 149 Widget* child = Widget::CreateWindowWithParent(new ChildModalWindow, |
| 150 GetWidget()->GetNativeView()); | 150 GetWidget()->GetNativeView()); |
| 151 wm::SetModalParent(child->GetNativeView(), GetModalParent()); | 151 wm::SetModalParent(child->GetNativeView(), GetModalParent(), NULL, NULL); |
| 152 child->AddObserver(this); | 152 child->AddObserver(this); |
| 153 child->GetNativeView()->SetName("ChildModalWindow"); | 153 child->GetNativeView()->SetName("ChildModalWindow"); |
| 154 return child; | 154 return child; |
| 155 } | 155 } |
| 156 | 156 |
| 157 views::View* ChildModalParent::GetContentsView() { | 157 views::View* ChildModalParent::GetContentsView() { |
| 158 return this; | 158 return this; |
| 159 } | 159 } |
| 160 | 160 |
| 161 base::string16 ChildModalParent::GetWindowTitle() const { | 161 base::string16 ChildModalParent::GetWindowTitle() const { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 void ChildModalParent::OnWidgetDestroying(Widget* widget) { | 208 void ChildModalParent::OnWidgetDestroying(Widget* widget) { |
| 209 if (child_) { | 209 if (child_) { |
| 210 DCHECK_EQ(child_, widget); | 210 DCHECK_EQ(child_, widget); |
| 211 child_ = NULL; | 211 child_ = NULL; |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace test | 215 } // namespace test |
| 216 } // namespace ash | 216 } // namespace ash |
| OLD | NEW |