Index: chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm |
index 13a7a675901cd0ab82505366a8c075e9730d33a1..a5f173903485ed3790fa9ded08102ee7a8327780 100644 |
--- a/chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm |
@@ -15,6 +15,15 @@ NSRect ConvertRectToCocoaCoordinates(const gfx::Rect& bounds) { |
bounds.width(), bounds.height()); |
} |
+gfx::Rect ConvertRectFromCocoaCoordinates(NSRect bounds) { |
+ // Flip coordinates based on the primary screen. |
+ NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
+ |
+ return gfx::Rect( |
+ NSMinX(bounds), NSHeight([screen frame]) - NSMaxY(bounds), |
+ NSWidth(bounds), NSHeight(bounds)); |
+} |
+ |
NSPoint ConvertPointToCocoaCoordinates(const gfx::Point& point) { |
// Flip coordinates based on the primary screen. |
NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |