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

Unified Diff: ash/screen_util.cc

Issue 2660873002: Move two utility functions from ash/screen_util.h to ui/wm/core/coordinate_conversion.h (Closed)
Patch Set: rebase Created 3 years, 10 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/screen_util.h ('k') | ash/screen_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/screen_util.cc
diff --git a/ash/screen_util.cc b/ash/screen_util.cc
index 29baadf4b85ffc545fe525a6750cc27308ffc318..ea11d87db5ac453ddf449773257f708bac8948a5 100644
--- a/ash/screen_util.cc
+++ b/ash/screen_util.cc
@@ -14,6 +14,7 @@
#include "ui/display/manager/display_manager.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/size_conversions.h"
+#include "ui/wm/core/coordinate_conversion.h"
namespace ash {
@@ -28,37 +29,18 @@ gfx::Rect ScreenUtil::GetMaximizedWindowBoundsInParent(aura::Window* window) {
// static
gfx::Rect ScreenUtil::GetDisplayBoundsInParent(aura::Window* window) {
- return ConvertRectFromScreen(
- window->parent(),
- display::Screen::GetScreen()->GetDisplayNearestWindow(window).bounds());
+ gfx::Rect result =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(window).bounds();
+ ::wm::ConvertRectFromScreen(window->parent(), &result);
+ return result;
}
// static
gfx::Rect ScreenUtil::GetDisplayWorkAreaBoundsInParent(aura::Window* window) {
- return ConvertRectFromScreen(window->parent(),
- display::Screen::GetScreen()
- ->GetDisplayNearestWindow(window)
- .work_area());
+ gfx::Rect result =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area();
+ ::wm::ConvertRectFromScreen(window->parent(), &result);
+ return result;
}
-// static
-gfx::Rect ScreenUtil::ConvertRectToScreen(aura::Window* window,
- const gfx::Rect& rect) {
- gfx::Point point = rect.origin();
- aura::client::GetScreenPositionClient(window->GetRootWindow())
- ->ConvertPointToScreen(window, &point);
- return gfx::Rect(point, rect.size());
-}
-
-// static
-gfx::Rect ScreenUtil::ConvertRectFromScreen(aura::Window* window,
- const gfx::Rect& rect) {
- gfx::Point point = rect.origin();
- aura::client::GetScreenPositionClient(window->GetRootWindow())
- ->ConvertPointFromScreen(window, &point);
- return gfx::Rect(point, rect.size());
-}
-
-// static
-
} // namespace ash
« no previous file with comments | « 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