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

Unified Diff: ash/wm/lock_window_state.cc

Issue 2215223004: mash: Migrate ShelfLayoutManager ScreenUtil usage to ash common types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore screen bounds conversion for app list. Created 4 years, 4 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/system/toast/toast_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/lock_window_state.cc
diff --git a/ash/wm/lock_window_state.cc b/ash/wm/lock_window_state.cc
index 4e1254f920552c4cd12dcc14eddb8d2e1a4614f6..59a6490d85367574a28e606d77e2eddacaba28a8 100644
--- a/ash/wm/lock_window_state.cc
+++ b/ash/wm/lock_window_state.cc
@@ -12,8 +12,9 @@
#include "ash/common/wm/window_state_delegate.h"
#include "ash/common/wm/window_state_util.h"
#include "ash/common/wm/wm_event.h"
+#include "ash/common/wm/wm_screen_util.h"
+#include "ash/common/wm_shell.h"
#include "ash/display/display_manager.h"
-#include "ash/screen_util.h"
#include "ash/shell.h"
#include "ash/wm/lock_layout_manager.h"
#include "ash/wm/window_animations.h"
@@ -168,14 +169,9 @@ wm::WindowStateType LockWindowState::GetMaximizedOrCenteredWindowType(
}
gfx::Rect GetBoundsForLockWindow(aura::Window* window) {
- DisplayManager* display_manager = Shell::GetInstance()->display_manager();
- if (display_manager->IsInUnifiedMode()) {
- const display::Display& first =
- display_manager->software_mirroring_display_list()[0];
- return first.bounds();
- } else {
- return ScreenUtil::GetDisplayBoundsInParent(window);
- }
+ if (WmShell::Get()->IsInUnifiedMode())
+ return WmShell::Get()->GetFirstDisplay().bounds();
+ return wm::GetDisplayBoundsInParent(WmWindowAura::Get(window));
}
void LockWindowState::UpdateBounds(wm::WindowState* window_state) {
@@ -190,9 +186,7 @@ void LockWindowState::UpdateBounds(wm::WindowState* window_state) {
keyboard_controller->keyboard_visible()) {
keyboard_bounds = keyboard_controller->current_keyboard_bounds();
}
- gfx::Rect bounds = ScreenUtil::GetShelfDisplayBoundsInRoot(
- ash::WmWindowAura::GetAuraWindow(window_state->window()));
-
+ gfx::Rect bounds = wm::GetDisplayBoundsWithShelf(window_state->window());
bounds.set_height(bounds.height() - keyboard_bounds.height());
VLOG(1) << "Updating window bounds to: " << bounds.ToString();
« no previous file with comments | « ash/system/toast/toast_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698