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

Unified Diff: content/browser/renderer_host/input/web_input_event_builders_mac.mm

Issue 1777483005: Prepare content/ module for compilation with OS X 10.7 deployment target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp89_107_ui
Patch Set: Fix bugs. Created 4 years, 9 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/web_input_event_builders_mac.mm
diff --git a/content/browser/renderer_host/input/web_input_event_builders_mac.mm b/content/browser/renderer_host/input/web_input_event_builders_mac.mm
index 82386ed545036c57be7cf4378c0c45864761691f..2e8ea376b856638125284351bfa9cf527ce25316 100644
--- a/content/browser/renderer_host/input/web_input_event_builders_mac.mm
+++ b/content/browser/renderer_host/input/web_input_event_builders_mac.mm
@@ -39,6 +39,7 @@
#include "base/strings/string_util.h"
#include "content/browser/renderer_host/input/web_input_event_util.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
+#include "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/events/keycodes/keyboard_code_conversion.h"
#include "ui/events/keycodes/keyboard_code_conversion_mac.h"
@@ -516,9 +517,8 @@ int ModifiersFromEvent(NSEvent* event) {
void SetWebEventLocationFromEventInView(blink::WebMouseEvent* result,
NSEvent* event,
NSView* view) {
- NSPoint window_local = [event locationInWindow];
-
- NSPoint screen_local = [[view window] convertBaseToScreen:window_local];
+ NSPoint screen_local = ui::ConvertPointFromWindowToScreen(
+ [view window], [event locationInWindow]);
result->globalX = screen_local.x;
// Flip y.
NSScreen* primary_screen = ([[NSScreen screens] count] > 0)
@@ -529,7 +529,8 @@ void SetWebEventLocationFromEventInView(blink::WebMouseEvent* result,
else
result->globalY = screen_local.y;
- NSPoint content_local = [view convertPoint:window_local fromView:nil];
+ NSPoint content_local =
+ [view convertPoint:[event locationInWindow] fromView:nil];
result->x = content_local.x;
result->y = [view frame].size.height - content_local.y; // Flip y.
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698