Chromium Code Reviews| Index: ash/common/wm/wm_screen_util.cc |
| diff --git a/ash/common/wm/wm_screen_util.cc b/ash/common/wm/wm_screen_util.cc |
| index 92a268fb4cd8ef4ee6a6bc162109f267e5ca49fd..61af6f65a2623c7f2c8ac734f8ed86b7cbcd4ebe 100644 |
| --- a/ash/common/wm/wm_screen_util.cc |
| +++ b/ash/common/wm/wm_screen_util.cc |
| @@ -5,8 +5,11 @@ |
| #include "ash/common/wm/wm_screen_util.h" |
| #include "ash/common/wm_root_window_controller.h" |
| +#include "ash/common/wm_shell.h" |
| #include "ash/common/wm_window.h" |
| #include "ui/display/display.h" |
| +#include "ui/display/screen.h" |
| +#include "ui/gfx/geometry/size_conversions.h" |
| namespace ash { |
| namespace wm { |
| @@ -32,5 +35,17 @@ gfx::Rect GetMaximizedWindowBoundsInParent(WmWindow* window) { |
| return GetDisplayBoundsInParent(window); |
| } |
| +gfx::Rect GetShelfDisplayBoundsForWindow(WmWindow* window) { |
| + if (WmShell::Get()->IsInUnifiedMode()) { |
| + // In unified desktop mode, there is only one shelf in the first display. |
| + gfx::SizeF size(WmShell::Get()->GetFirstDisplay().size()); |
| + float scale = window->GetRootWindow()->GetBounds().height() / size.height(); |
| + size.Scale(scale, scale); |
| + return gfx::Rect(gfx::ToCeiledSize(size)); |
| + } |
|
James Cook
2016/08/05 23:51:25
Just FYI, taking out the in_mus() pieces of this f
msw
2016/08/06 00:08:13
Yeah, I though it would break mash shelf layout, a
|
| + |
| + return window->GetRootWindow()->GetBounds(); |
| +} |
| + |
| } // namespace wm |
| } // namespace ash |