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

Unified Diff: ash/wm/window_positioner.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_cycle_list.cc ('k') | ash/wm/window_positioner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_positioner.cc
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc
index 2bb469c9cd7179f8a6df59427ab52a1554f19002..99d86e54143a3656b5db7181385da7a4eecdd2d7 100644
--- a/ash/wm/window_positioner.cc
+++ b/ash/wm/window_positioner.cc
@@ -219,9 +219,10 @@ void WindowPositioner::GetBoundsAndShowStateForNewWindow(
gfx::Rect* bounds_in_out,
ui::WindowShowState* show_state_out) {
// Always open new window in the target display.
- WmWindow* target = Shell::GetWmRootWindowForNewWindows();
+ aura::Window* target = Shell::GetRootWindowForNewWindows();
- WmWindow* top_window = GetReferenceWindow(target, nullptr, nullptr);
+ WmWindow* top_window =
+ GetReferenceWindow(WmWindow::Get(target), nullptr, nullptr);
// Our window should not have any impact if we are already on top.
if (top_window == new_window)
top_window = nullptr;
@@ -229,7 +230,9 @@ void WindowPositioner::GetBoundsAndShowStateForNewWindow(
// If there is no valid other window we take and adjust the passed coordinates
// and show state.
if (!top_window) {
- gfx::Rect work_area = target->GetDisplayNearestWindow().work_area();
+ gfx::Rect work_area = display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(target)
+ .work_area();
bounds_in_out->AdjustToFit(work_area);
// Use adjusted saved bounds, if there is one.
@@ -274,7 +277,9 @@ void WindowPositioner::GetBoundsAndShowStateForNewWindow(
gfx::Vector2d(kMinimumWindowOffset, kMinimumWindowOffset);
}
if (is_saved_bounds || has_restore_bounds) {
- gfx::Rect work_area = target->GetDisplayNearestWindow().work_area();
+ gfx::Rect work_area = display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(target)
+ .work_area();
bounds_in_out->AdjustToFit(work_area);
// Use adjusted saved bounds or restore bounds, if there is one.
return;
« no previous file with comments | « ash/wm/window_cycle_list.cc ('k') | ash/wm/window_positioner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698