| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/test/child_modal_window.h" | 5 #include "ui/views/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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 gfx::NativeWindow ChildModalParent::GetChild() const { | 144 gfx::NativeWindow ChildModalParent::GetChild() const { |
| 145 if (child_) | 145 if (child_) |
| 146 return child_->GetNativeView(); | 146 return child_->GetNativeView(); |
| 147 return NULL; | 147 return NULL; |
| 148 } | 148 } |
| 149 | 149 |
| 150 Widget* ChildModalParent::CreateChild() { | 150 Widget* ChildModalParent::CreateChild() { |
| 151 Widget* child = Widget::CreateWindowWithParent( | 151 Widget* child = Widget::CreateWindowWithParent( |
| 152 new ChildModalWindow, GetWidget()->GetNativeView()); | 152 new ChildModalWindow, GetWidget()->GetNativeView()); |
| 153 corewm::SetModalParent(child->GetNativeView(), GetModalParent()); | 153 wm::SetModalParent(child->GetNativeView(), GetModalParent()); |
| 154 child->AddObserver(this); | 154 child->AddObserver(this); |
| 155 child->GetNativeView()->SetName("ChildModalWindow"); | 155 child->GetNativeView()->SetName("ChildModalWindow"); |
| 156 return child; | 156 return child; |
| 157 } | 157 } |
| 158 | 158 |
| 159 View* ChildModalParent::GetContentsView() { | 159 View* ChildModalParent::GetContentsView() { |
| 160 return this; | 160 return this; |
| 161 } | 161 } |
| 162 | 162 |
| 163 base::string16 ChildModalParent::GetWindowTitle() const { | 163 base::string16 ChildModalParent::GetWindowTitle() const { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 void ChildModalParent::OnWidgetDestroying(Widget* widget) { | 210 void ChildModalParent::OnWidgetDestroying(Widget* widget) { |
| 211 if (child_) { | 211 if (child_) { |
| 212 DCHECK_EQ(child_, widget); | 212 DCHECK_EQ(child_, widget); |
| 213 child_ = NULL; | 213 child_ = NULL; |
| 214 } | 214 } |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace test | 217 } // namespace test |
| 218 } // namespace views | 218 } // namespace views |
| OLD | NEW |