Index: content/browser/renderer_host/web_input_event_aura.cc |
diff --git a/content/browser/renderer_host/web_input_event_aura.cc b/content/browser/renderer_host/web_input_event_aura.cc |
index d92fdca5b480e448e5a87d83deb853897474197a..e800303e2560179066642dac1ccc86ec18bd3864 100644 |
--- a/content/browser/renderer_host/web_input_event_aura.cc |
+++ b/content/browser/renderer_host/web_input_event_aura.cc |
@@ -5,6 +5,7 @@ |
#include "content/browser/renderer_host/web_input_event_aura.h" |
#include "ui/aura/event.h" |
+#include "ui/aura/window.h" |
namespace content { |
@@ -50,7 +51,8 @@ WebKit::WebTouchPoint* UpdateWebTouchEventFromAuraEvent( |
// aura::MouseEvent. This will not be necessary once only XInput2 is supported. |
// |
-WebKit::WebMouseEvent MakeWebMouseEvent(aura::MouseEvent* event) { |
+WebKit::WebMouseEvent MakeWebMouseEvent(aura::MouseEvent* event, |
+ aura::Window* window) { |
#if defined(OS_WIN) |
// Construct an untranslated event from the platform event data. |
WebKit::WebMouseEvent webkit_event = |
@@ -64,14 +66,16 @@ WebKit::WebMouseEvent MakeWebMouseEvent(aura::MouseEvent* event) { |
webkit_event.windowX = webkit_event.x = event->x(); |
webkit_event.windowY = webkit_event.y = event->y(); |
- // TODO(beng): map these to screen coordinates. |
- webkit_event.globalX = event->x(); |
- webkit_event.globalY = event->y(); |
+ const gfx::Point screen_point = |
sadrul
2011/10/27 22:47:20
For the screen-location, it would be nice if we ca
Ben Goodger (Google)
2011/10/27 22:56:11
We can assume "screen" to mean "client position wi
Daniel Erat
2011/10/28 00:53:13
Done.
|
+ window->GetPointInScreenCoordinates(event->location()); |
+ webkit_event.globalX = screen_point.x(); |
+ webkit_event.globalY = screen_point.y(); |
return webkit_event; |
} |
-WebKit::WebMouseWheelEvent MakeWebMouseWheelEvent(aura::MouseEvent* event) { |
+WebKit::WebMouseWheelEvent MakeWebMouseWheelEvent(aura::MouseEvent* event, |
+ aura::Window* window) { |
#if defined(OS_WIN) |
// Construct an untranslated event from the platform event data. |
WebKit::WebMouseWheelEvent webkit_event = |
@@ -86,9 +90,10 @@ WebKit::WebMouseWheelEvent MakeWebMouseWheelEvent(aura::MouseEvent* event) { |
webkit_event.windowX = webkit_event.x = event->x(); |
webkit_event.windowY = webkit_event.y = event->y(); |
- // TODO(beng): map these to screen coordinates. |
- webkit_event.globalX = event->x(); |
- webkit_event.globalY = event->y(); |
+ const gfx::Point screen_point = |
+ window->GetPointInScreenCoordinates(event->location()); |
+ webkit_event.globalX = screen_point.x(); |
+ webkit_event.globalY = screen_point.y(); |
return webkit_event; |
} |