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

Unified Diff: ui/views/event_monitor_mac.mm

Issue 1747803003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/views/event_monitor_mac.mm
diff --git a/ui/views/event_monitor_mac.mm b/ui/views/event_monitor_mac.mm
index 45578c9948a43fbedafc6e81c1be4cdadfa7190d..f21aae7cdd3b6d4a2cc593ead107b3f17104ba34 100644
--- a/ui/views/event_monitor_mac.mm
+++ b/ui/views/event_monitor_mac.mm
@@ -10,6 +10,7 @@
#include "ui/events/event.h"
#include "ui/events/event_handler.h"
#include "ui/events/event_utils.h"
+#include "ui/gfx/screen.h"
namespace views {
@@ -28,11 +29,7 @@ scoped_ptr<EventMonitor> EventMonitor::CreateWindowMonitor(
// static
gfx::Point EventMonitor::GetLastMouseLocation() {
- NSPoint mouseLocation = [NSEvent mouseLocation];
- // Flip coordinates to gfx (0,0 in top-left corner) using primary screen.
- NSScreen* screen = [[NSScreen screens] firstObject];
- mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y;
- return gfx::Point(mouseLocation.x, mouseLocation.y);
+ return gfx::Screen::GetScreen()->GetCursorScreenPoint();
tapted 2016/03/01 08:11:58 these refactorings are good,but they should land s
}
EventMonitorMac::EventMonitorMac(ui::EventHandler* event_handler,

Powered by Google App Engine
This is Rietveld 408576698