| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/wm/core/transient_window_stacking_client.h" | 5 #include "ui/wm/core/transient_window_stacking_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/wm/core/transient_window_manager.h" | 9 #include "ui/wm/core/transient_window_manager.h" |
| 10 #include "ui/wm/core/window_util.h" | 10 #include "ui/wm/core/window_util.h" |
| 11 | 11 |
| 12 using aura::Window; | 12 using aura::Window; |
| 13 | 13 |
| 14 namespace views { | 14 namespace wm { |
| 15 namespace corewm { | |
| 16 | 15 |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 // Populates |ancestors| with all transient ancestors of |window| that are | 18 // Populates |ancestors| with all transient ancestors of |window| that are |
| 20 // siblings of |window|. Returns true if any ancestors were found, false if not. | 19 // siblings of |window|. Returns true if any ancestors were found, false if not. |
| 21 bool GetAllTransientAncestors(Window* window, Window::Windows* ancestors) { | 20 bool GetAllTransientAncestors(Window* window, Window::Windows* ancestors) { |
| 22 Window* parent = window->parent(); | 21 Window* parent = window->parent(); |
| 23 for (; window; window = GetTransientParent(window)) { | 22 for (; window; window = GetTransientParent(window)) { |
| 24 if (window->parent() == parent) | 23 if (window->parent() == parent) |
| 25 ancestors->push_back(window); | 24 ancestors->push_back(window); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 122 |
| 124 // If we couldn't find a valid target position, don't move anything. | 123 // If we couldn't find a valid target position, don't move anything. |
| 125 if (*direction == Window::STACK_ABOVE && | 124 if (*direction == Window::STACK_ABOVE && |
| 126 ((*target)->layer() && (*target)->layer()->delegate() == NULL)) { | 125 ((*target)->layer() && (*target)->layer()->delegate() == NULL)) { |
| 127 return false; | 126 return false; |
| 128 } | 127 } |
| 129 | 128 |
| 130 return *child != *target; | 129 return *child != *target; |
| 131 } | 130 } |
| 132 | 131 |
| 133 } // namespace corewm | 132 } // namespace wm |
| 134 } // namespace views | |
| OLD | NEW |