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

Unified Diff: ui/gfx/geometry/point.cc

Issue 1092033006: [Mac/Cleanup] Trim down Foundation.h and ApplicationServices.h includes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include -> import Created 5 years, 8 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/gfx/geometry/point.h ('k') | ui/gfx/geometry/rect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ui/gfx/geometry/point.h ('k') | ui/gfx/geometry/rect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698