| 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 "ash/wm/window_util.h" | 5 #include "ash/wm/window_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/wm/window_properties.h" | 12 #include "ash/wm/window_properties.h" |
| 13 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
| 14 #include "ui/aura/client/activation_client.h" | 14 #include "ui/aura/client/activation_client.h" |
| 15 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
| 16 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
| 17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 18 #include "ui/gfx/display.h" | 18 #include "ui/gfx/display.h" |
| 19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 20 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
| 21 #include "ui/views/corewm/transient_window_manager.h" |
| 21 #include "ui/views/corewm/window_util.h" | 22 #include "ui/views/corewm/window_util.h" |
| 22 #include "ui/views/view.h" | 23 #include "ui/views/view.h" |
| 23 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 24 | 25 |
| 25 namespace ash { | 26 namespace ash { |
| 26 namespace wm { | 27 namespace wm { |
| 27 | 28 |
| 28 // TODO(beng): replace many of these functions with the corewm versions. | 29 // TODO(beng): replace many of these functions with the corewm versions. |
| 29 void ActivateWindow(aura::Window* window) { | 30 void ActivateWindow(aura::Window* window) { |
| 30 views::corewm::ActivateWindow(window); | 31 views::corewm::ActivateWindow(window); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 aura::Window* old_parent, | 128 aura::Window* old_parent, |
| 128 aura::Window* new_parent) { | 129 aura::Window* new_parent) { |
| 129 if (child->parent() == old_parent) | 130 if (child->parent() == old_parent) |
| 130 new_parent->AddChild(child); | 131 new_parent->AddChild(child); |
| 131 ReparentTransientChildrenOfChild(child, old_parent, new_parent); | 132 ReparentTransientChildrenOfChild(child, old_parent, new_parent); |
| 132 } | 133 } |
| 133 | 134 |
| 134 void ReparentTransientChildrenOfChild(aura::Window* child, | 135 void ReparentTransientChildrenOfChild(aura::Window* child, |
| 135 aura::Window* old_parent, | 136 aura::Window* old_parent, |
| 136 aura::Window* new_parent) { | 137 aura::Window* new_parent) { |
| 137 for (size_t i = 0; i < child->transient_children().size(); ++i) { | 138 for (size_t i = 0; |
| 138 ReparentChildWithTransientChildren(child->transient_children()[i], | 139 i < views::corewm::GetTransientChildren(child).size(); |
| 139 old_parent, | 140 ++i) { |
| 140 new_parent); | 141 ReparentChildWithTransientChildren( |
| 142 views::corewm::GetTransientChildren(child)[i], |
| 143 old_parent, |
| 144 new_parent); |
| 141 } | 145 } |
| 142 } | 146 } |
| 143 | 147 |
| 144 } // namespace wm | 148 } // namespace wm |
| 145 } // namespace ash | 149 } // namespace ash |
| OLD | NEW |