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

Side by Side Diff: ash/common/wm/window_positioning_utils.cc

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: remove ash:: Created 3 years, 9 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_positioner.cc ('k') | ash/common/wm_shell.h » ('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 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/common/wm/window_positioning_utils.h" 5 #include "ash/common/wm/window_positioning_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/wm/system_modal_container_layout_manager.h" 9 #include "ash/common/wm/system_modal_container_layout_manager.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // the bounds if necessary. 171 // the bounds if necessary.
172 window->SetBounds(new_bounds); 172 window->SetBounds(new_bounds);
173 173
174 dst_container->AddChild(window); 174 dst_container->AddChild(window);
175 175
176 MoveAllTransientChildrenToNewRoot(display, window); 176 MoveAllTransientChildrenToNewRoot(display, window);
177 177
178 // Restore focused/active window. 178 // Restore focused/active window.
179 if (focused && tracker.Contains(focused->aura_window())) { 179 if (focused && tracker.Contains(focused->aura_window())) {
180 focused->SetFocused(); 180 focused->SetFocused();
181 WmShell::Get()->set_root_window_for_new_windows( 181 Shell::GetInstance()->set_root_window_for_new_windows(
182 focused->GetRootWindow()); 182 focused->GetRootWindow());
183 } else if (active && tracker.Contains(active->aura_window())) { 183 } else if (active && tracker.Contains(active->aura_window())) {
184 active->Activate(); 184 active->Activate();
185 } 185 }
186 // TODO(oshima): We should not have to update the bounds again 186 // TODO(oshima): We should not have to update the bounds again
187 // below in theory, but we currently do need as there is a code 187 // below in theory, but we currently do need as there is a code
188 // that assumes that the bounds will never be overridden by the 188 // that assumes that the bounds will never be overridden by the
189 // layout mananger. We should have more explicit control how 189 // layout mananger. We should have more explicit control how
190 // constraints are applied by the layout manager. 190 // constraints are applied by the layout manager.
191 } 191 }
192 } 192 }
193 gfx::Point origin(bounds_in_screen.origin()); 193 gfx::Point origin(bounds_in_screen.origin());
194 const gfx::Point display_origin = 194 const gfx::Point display_origin =
195 window->GetDisplayNearestWindow().bounds().origin(); 195 window->GetDisplayNearestWindow().bounds().origin();
196 origin.Offset(-display_origin.x(), -display_origin.y()); 196 origin.Offset(-display_origin.x(), -display_origin.y());
197 window->SetBounds(gfx::Rect(origin, bounds_in_screen.size())); 197 window->SetBounds(gfx::Rect(origin, bounds_in_screen.size()));
198 } 198 }
199 199
200 } // namespace wm 200 } // namespace wm
201 } // namespace ash 201 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/window_positioner.cc ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698