Index: ash/screen_util.cc |
diff --git a/ash/screen_util.cc b/ash/screen_util.cc |
index 0e19b9dfc8e3c6790bed997063477d966a8a41e5..95b70ca124294a73d698025511a27a16c7f7d225 100644 |
--- a/ash/screen_util.cc |
+++ b/ash/screen_util.cc |
@@ -52,6 +52,20 @@ gfx::Rect ScreenUtil::GetDisplayWorkAreaBoundsInParent(aura::Window* window) { |
Shell::GetScreen()->GetDisplayNearestWindow(window).work_area()); |
} |
+gfx::Rect ScreenUtil::GetShelfDisplayBoundsInScreen(aura::Window* root_window) { |
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
+ if (display_manager->IsInUnifiedMode()) { |
+ // In unified desktop mode, there is only one shelf in the 1st display. |
+ const gfx::Display& first = |
+ display_manager->software_mirroring_display_list()[0]; |
+ return first.bounds(); |
+ } else { |
+ return gfx::Screen::GetScreenFor(root_window) |
+ ->GetDisplayNearestWindow(root_window) |
+ .bounds(); |
+ } |
+} |
+ |
// static |
gfx::Rect ScreenUtil::ConvertRectToScreen(aura::Window* window, |
const gfx::Rect& rect) { |
@@ -79,9 +93,4 @@ const gfx::Display& ScreenUtil::GetSecondaryDisplay() { |
display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); |
} |
-// static |
-const gfx::Display& ScreenUtil::GetDisplayForId(int64 display_id) { |
- return GetDisplayManager()->GetDisplayForId(display_id); |
-} |
- |
} // namespace ash |