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

Unified Diff: ui/gfx/screen_mac.mm

Issue 7981012: Add Mouse hover behavior to Mac Panels when minimized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unused constant Created 9 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: ui/gfx/screen_mac.mm
diff --git a/ui/gfx/screen_mac.mm b/ui/gfx/screen_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..b38344ac76b85d9217aa67efbcaf663b94f08103
--- /dev/null
+++ b/ui/gfx/screen_mac.mm
@@ -0,0 +1,20 @@
+// Copyright (c) 2011 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.
+
+#include "ui/gfx/screen.h"
+
+#import <Cocoa/Cocoa.h>
+
+namespace gfx {
+
+// static
+gfx::Point Screen::GetCursorScreenPoint() {
+ NSPoint mouseLocation = [NSEvent mouseLocation];
+ // Flip coordinates to gfx (0,0 in top-left corner) using primary screen.
+ NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
jennb 2011/09/21 17:48:19 Is it safe to use screen 0 even if the mouse is on
+ mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y;
+ return gfx::Point(mouseLocation.x, mouseLocation.y);
+}
+
+} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698