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

Unified Diff: chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm

Issue 23918002: Switch to doing user-resizing via system for panels on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to reland Created 7 years, 3 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: 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];
« no previous file with comments | « chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h ('k') | chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698