Index: ui/gfx/geometry/point.cc |
diff --git a/ui/gfx/geometry/point.cc b/ui/gfx/geometry/point.cc |
index 2248a4dbe7e654dd109b6e2b4ccf829beba88457..cf8919e2573332295b35e211f83ea35ad78a6e67 100644 |
--- a/ui/gfx/geometry/point.cc |
+++ b/ui/gfx/geometry/point.cc |
@@ -6,6 +6,10 @@ |
#if defined(OS_WIN) |
#include <windows.h> |
+#elif defined(OS_IOS) |
+#include <CoreGraphics/CoreGraphics.h> |
+#elif defined(OS_MACOSX) |
+#include <ApplicationServices/ApplicationServices.h> |
#endif |
#include "base/strings/stringprintf.h" |
@@ -27,13 +31,22 @@ Point& Point::operator=(const POINT& point) { |
y_ = point.y; |
return *this; |
} |
+#elif defined(OS_MACOSX) |
+Point::Point(const CGPoint& point) : x_(point.x), y_(point.y) { |
+} |
+#endif |
+#if defined(OS_WIN) |
POINT Point::ToPOINT() const { |
POINT p; |
p.x = x(); |
p.y = y(); |
return p; |
} |
+#elif defined(OS_MACOSX) |
+CGPoint Point::ToCGPoint() const { |
+ return CGPointMake(x(), y()); |
+} |
#endif |
void Point::SetToMin(const Point& other) { |