OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_positioning_utils.h" | 5 #include "ash/wm/window_positioning_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 Shell::GetRootWindowControllerWithDisplayId(display.id()); | 145 Shell::GetRootWindowControllerWithDisplayId(display.id()); |
146 DCHECK(dst_root_window_controller); | 146 DCHECK(dst_root_window_controller); |
147 WmWindow* dst_root = dst_root_window_controller->GetWindow(); | 147 WmWindow* dst_root = dst_root_window_controller->GetWindow(); |
148 DCHECK(dst_root); | 148 DCHECK(dst_root); |
149 WmWindow* dst_container = nullptr; | 149 WmWindow* dst_container = nullptr; |
150 if (dst_root != window->GetRootWindow()) { | 150 if (dst_root != window->GetRootWindow()) { |
151 int container_id = window->GetParent()->aura_window()->id(); | 151 int container_id = window->GetParent()->aura_window()->id(); |
152 // All containers that uses screen coordinates must have valid window ids. | 152 // All containers that uses screen coordinates must have valid window ids. |
153 DCHECK_GE(container_id, 0); | 153 DCHECK_GE(container_id, 0); |
154 // Don't move modal background. | 154 // Don't move modal background. |
155 if (!SystemModalContainerLayoutManager::IsModalBackground(window)) | 155 if (!SystemModalContainerLayoutManager::IsModalBackground( |
| 156 window->aura_window())) |
156 dst_container = dst_root->GetChildByShellWindowId(container_id); | 157 dst_container = dst_root->GetChildByShellWindowId(container_id); |
157 } | 158 } |
158 | 159 |
159 if (dst_container && window->GetParent() != dst_container) { | 160 if (dst_container && window->GetParent() != dst_container) { |
160 WmWindow* focused = WmWindow::Get(GetFocusedWindow()); | 161 WmWindow* focused = WmWindow::Get(GetFocusedWindow()); |
161 WmWindow* active = WmWindow::Get(GetActiveWindow()); | 162 WmWindow* active = WmWindow::Get(GetActiveWindow()); |
162 | 163 |
163 aura::WindowTracker tracker; | 164 aura::WindowTracker tracker; |
164 if (focused) | 165 if (focused) |
165 tracker.Add(focused->aura_window()); | 166 tracker.Add(focused->aura_window()); |
(...skipping 29 matching lines...) Expand all Loading... |
195 } | 196 } |
196 gfx::Point origin(bounds_in_screen.origin()); | 197 gfx::Point origin(bounds_in_screen.origin()); |
197 const gfx::Point display_origin = | 198 const gfx::Point display_origin = |
198 window->GetDisplayNearestWindow().bounds().origin(); | 199 window->GetDisplayNearestWindow().bounds().origin(); |
199 origin.Offset(-display_origin.x(), -display_origin.y()); | 200 origin.Offset(-display_origin.x(), -display_origin.y()); |
200 window->SetBounds(gfx::Rect(origin, bounds_in_screen.size())); | 201 window->SetBounds(gfx::Rect(origin, bounds_in_screen.size())); |
201 } | 202 } |
202 | 203 |
203 } // namespace wm | 204 } // namespace wm |
204 } // namespace ash | 205 } // namespace ash |
OLD | NEW |