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

Unified Diff: ash/screen_util.cc

Issue 2860163005: chromeos: gets rid of wm_screen_util (Closed)
Patch Set: include Created 3 years, 7 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
Index: ash/screen_util.cc
diff --git a/ash/screen_util.cc b/ash/screen_util.cc
index d7c7c831c42f0988cd66a0813b3018b84825b618..af12586f0cde5ab920239c1b53a005d08064c3cd 100644
--- a/ash/screen_util.cc
+++ b/ash/screen_util.cc
@@ -7,6 +7,7 @@
#include "ash/root_window_controller.h"
#include "ash/shelf/wm_shelf.h"
#include "ash/shell.h"
+#include "ash/shell_port.h"
#include "base/logging.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/window_event_dispatcher.h"
@@ -23,8 +24,7 @@ gfx::Rect ScreenUtil::GetMaximizedWindowBoundsInParent(aura::Window* window) {
aura::Window* root_window = window->GetRootWindow();
if (GetRootWindowController(root_window)->wm_shelf()->shelf_widget())
return GetDisplayWorkAreaBoundsInParent(window);
- else
- return GetDisplayBoundsInParent(window);
+ return GetDisplayBoundsInParent(window);
}
// static
@@ -43,4 +43,17 @@ gfx::Rect ScreenUtil::GetDisplayWorkAreaBoundsInParent(aura::Window* window) {
return result;
}
+// 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.
+ gfx::SizeF size(ShellPort::Get()->GetFirstDisplay().size());
+ float scale = window->GetRootWindow()->bounds().height() / size.height();
+ size.Scale(scale, scale);
+ return gfx::Rect(gfx::ToCeiledSize(size));
+ }
+
+ return window->GetRootWindow()->bounds();
+}
+
} // namespace ash
« ash/screen_util.h ('K') | « ash/screen_util.h ('k') | ash/screen_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698