Index: ash/screen_util.cc |
diff --git a/ash/screen_util.cc b/ash/screen_util.cc |
index 1b674ebd37eadb88e2c691a80f3564cc8a206949..6035197427b4c23421070e6a31aed0f3336b2685 100644 |
--- a/ash/screen_util.cc |
+++ b/ash/screen_util.cc |
@@ -8,6 +8,7 @@ |
#include "ash/shelf/shelf.h" |
#include "ash/shell.h" |
#include "ash/shell_port.h" |
+#include "ash/wm_window.h" |
#include "base/logging.h" |
#include "ui/aura/client/screen_position_client.h" |
#include "ui/aura/window_event_dispatcher.h" |
@@ -44,6 +45,17 @@ gfx::Rect ScreenUtil::GetDisplayWorkAreaBoundsInParent(aura::Window* window) { |
} |
// static |
+gfx::Rect ScreenUtil::GetDisplayWorkAreaBoundsInParentForLockScreen( |
+ aura::Window* window) { |
+ Shelf* shelf = Shelf::ForWindow(window); |
+ if (!shelf) |
+ return GetDisplayBoundsInParent(window); |
oshima
2017/05/25 19:49:59
nit: looks like shelf shouldn't be null? If so, pl
tbarzic
2017/05/25 20:32:20
yeah, it seems so.
Done.
|
+ gfx::Rect bounds = shelf->GetUserWorkAreaBounds(); |
+ ::wm::ConvertRectFromScreen(window->parent(), &bounds); |
+ return bounds; |
+} |
+ |
+// static |
gfx::Rect ScreenUtil::GetDisplayBoundsWithShelf(aura::Window* window) { |
if (ShellPort::Get()->IsInUnifiedMode()) { |
// In unified desktop mode, there is only one shelf in the first display. |