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

Unified Diff: ui/gfx/mac/point_utils.h

Issue 353643002: MacViews: Implement Set/Get*Bounds for NativeWidgetMac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine Created 6 years, 6 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: ui/gfx/mac/point_utils.h
diff --git a/ui/gfx/mac/point_utils.h b/ui/gfx/mac/point_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..a22a71c2785e9cef0431c2b2cdabe4b6eea68c6f
--- /dev/null
+++ b/ui/gfx/mac/point_utils.h
@@ -0,0 +1,26 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GFX_MAC_POINT_UTILS_H_
Robert Sesek 2014/06/25 17:06:04 Tests for these functions would be good.
tapted 2014/06/26 08:44:31 Done in https://codereview.chromium.org/345243007/
+#define UI_GFX_MAC_POINT_UTILS_H_
+
+#include "ui/gfx/gfx_export.h"
+
+typedef struct _NSRect NSRect;
+
+namespace gfx {
+
+class Rect;
+
+// Convert a gfx::Rect specified with the origin at the top left of the primary
+// display into AppKit secreen coordinates (origin at the bottom left).
+GFX_EXPORT NSRect ScreenRectToNSRect(const gfx::Rect& rect);
+
+// Convert an AppKit NSRect with origin in the bottom left of the primary
+// display into a gfx::Rect with origin at the top left of the primary display.
+GFX_EXPORT gfx::Rect ScreenRectFromNSRect(const NSRect& point);
+
+} // namespace gfx
+
+#endif // UI_GFX_MAC_POINT_UTILS_H_
tapted 2014/06/25 10:55:56 note: not sure it's the best filename, but I've pu
sky 2014/06/25 16:52:22 If you want this to be focused around screen conve
tapted 2014/06/26 08:44:31 Done - went with coordinate_conversions.h/mm (disc
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/gfx/mac/point_utils.mm » ('j') | ui/views/widget/native_widget_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698