Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: ash/display/screen_position_controller.cc

Issue 2336653002: Ports SystemModalContainerLayoutManager to ash/common (Closed)
Patch Set: merge again Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/wm_window_property.h ('k') | ash/mus/bridge/wm_window_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/display/screen_position_controller.h" 5 #include "ash/display/screen_position_controller.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm/system_modal_container_layout_manager.h"
9 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
10 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
11 #include "ash/common/wm_window.h" 12 #include "ash/common/wm_window.h"
12 #include "ash/display/window_tree_host_manager.h" 13 #include "ash/display/window_tree_host_manager.h"
13 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
14 #include "ash/shell.h" 15 #include "ash/shell.h"
15 #include "ash/wm/system_modal_container_layout_manager.h"
16 #include "ash/wm/window_properties.h" 16 #include "ash/wm/window_properties.h"
17 #include "ui/aura/client/capture_client.h" 17 #include "ui/aura/client/capture_client.h"
18 #include "ui/aura/client/focus_client.h" 18 #include "ui/aura/client/focus_client.h"
19 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
20 #include "ui/aura/window_event_dispatcher.h" 20 #include "ui/aura/window_event_dispatcher.h"
21 #include "ui/aura/window_tracker.h" 21 #include "ui/aura/window_tracker.h"
22 #include "ui/aura/window_tree_host.h" 22 #include "ui/aura/window_tree_host.h"
23 #include "ui/compositor/dip_util.h" 23 #include "ui/compositor/dip_util.h"
24 #include "ui/display/display.h" 24 #include "ui/display/display.h"
25 #include "ui/display/screen.h" 25 #include "ui/display/screen.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 aura::Window* dst_root = Shell::GetInstance() 174 aura::Window* dst_root = Shell::GetInstance()
175 ->window_tree_host_manager() 175 ->window_tree_host_manager()
176 ->GetRootWindowForDisplayId(display.id()); 176 ->GetRootWindowForDisplayId(display.id());
177 DCHECK(dst_root); 177 DCHECK(dst_root);
178 aura::Window* dst_container = NULL; 178 aura::Window* dst_container = NULL;
179 if (dst_root != window->GetRootWindow()) { 179 if (dst_root != window->GetRootWindow()) {
180 int container_id = window->parent()->id(); 180 int container_id = window->parent()->id();
181 // All containers that uses screen coordinates must have valid window ids. 181 // All containers that uses screen coordinates must have valid window ids.
182 DCHECK_GE(container_id, 0); 182 DCHECK_GE(container_id, 0);
183 // Don't move modal background. 183 // Don't move modal background.
184 if (!SystemModalContainerLayoutManager::IsModalBackground(window)) 184 if (!SystemModalContainerLayoutManager::IsModalBackground(
185 WmWindowAura::Get(window)))
185 dst_container = Shell::GetContainer(dst_root, container_id); 186 dst_container = Shell::GetContainer(dst_root, container_id);
186 } 187 }
187 188
188 if (dst_container && window->parent() != dst_container) { 189 if (dst_container && window->parent() != dst_container) {
189 aura::Window* focused = 190 aura::Window* focused =
190 aura::client::GetFocusClient(window)->GetFocusedWindow(); 191 aura::client::GetFocusClient(window)->GetFocusedWindow();
191 aura::client::ActivationClient* activation_client = 192 aura::client::ActivationClient* activation_client =
192 aura::client::GetActivationClient(window->GetRootWindow()); 193 aura::client::GetActivationClient(window->GetRootWindow());
193 aura::Window* active = activation_client->GetActiveWindow(); 194 aura::Window* active = activation_client->GetActiveWindow();
194 195
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 gfx::Point origin(bounds.origin()); 231 gfx::Point origin(bounds.origin());
231 const gfx::Point display_origin = display::Screen::GetScreen() 232 const gfx::Point display_origin = display::Screen::GetScreen()
232 ->GetDisplayNearestWindow(window) 233 ->GetDisplayNearestWindow(window)
233 .bounds() 234 .bounds()
234 .origin(); 235 .origin();
235 origin.Offset(-display_origin.x(), -display_origin.y()); 236 origin.Offset(-display_origin.x(), -display_origin.y());
236 window->SetBounds(gfx::Rect(origin, bounds.size())); 237 window->SetBounds(gfx::Rect(origin, bounds.size()));
237 } 238 }
238 239
239 } // namespace ash 240 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_window_property.h ('k') | ash/mus/bridge/wm_window_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698