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

Unified Diff: ui/wm/core/coordinate_conversion.cc

Issue 2660873002: Move two utility functions from ash/screen_util.h to ui/wm/core/coordinate_conversion.h (Closed)
Patch Set: Created 3 years, 11 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 | « ui/wm/core/coordinate_conversion.h ('k') | ui/wm/core/coordinate_conversion_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/coordinate_conversion.cc
diff --git a/ui/wm/core/coordinate_conversion.cc b/ui/wm/core/coordinate_conversion.cc
index 1d97f04f028b77142df28ad6abda174162b042f9..e5cfe07ece8d512be0ccc6e7997a82c856d08e0b 100644
--- a/ui/wm/core/coordinate_conversion.cc
+++ b/ui/wm/core/coordinate_conversion.cc
@@ -6,6 +6,7 @@
#include "ui/aura/client/screen_position_client.h"
#include "ui/gfx/geometry/point.h"
+#include "ui/gfx/geometry/rect.h"
namespace wm {
@@ -26,4 +27,17 @@ void ConvertPointFromScreen(const aura::Window* window,
ConvertPointFromScreen(window, point_in_screen);
}
+void ConvertRectToScreen(const aura::Window* window, gfx::Rect* rect) {
+ gfx::Point point = rect->origin();
+ ConvertPointToScreen(window, &point);
+ rect->set_origin(point);
sadrul 2017/01/31 16:58:12 It is possible for the window to be rotated/scaled
yhanada 2017/02/01 06:39:27 Done.
oshima 2017/02/01 18:50:56 It is not possible to convert rect to rect over ar
sadrul 2017/02/02 17:33:17 We should fix aura window. Even the new code isn't
+}
+
+void ConvertRectFromScreen(const aura::Window* window,
+ gfx::Rect* rect_in_screen) {
+ gfx::Point point = rect_in_screen->origin();
+ ConvertPointFromScreen(window, &point);
+ rect_in_screen->set_origin(point);
+}
+
} // namespace wm
« no previous file with comments | « ui/wm/core/coordinate_conversion.h ('k') | ui/wm/core/coordinate_conversion_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698