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

Unified Diff: ash/common/wm/wm_screen_util.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/common/wm/wm_screen_util.h ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fdc7396daa48112453c96507a99eda717540881a 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 GetDisplayBoundsWithShelf(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));
+ }
+
+ return window->GetRootWindow()->GetBounds();
+}
+
} // namespace wm
} // namespace ash
« no previous file with comments | « ash/common/wm/wm_screen_util.h ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698