Chromium Code Reviews| 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 4244cc367ce00de7f43d4d48b5f8064d75cc83bd..b70007ae7ed401164d4565f79cb3345689d86a1f 100644 |
| --- a/content/browser/renderer_host/web_input_event_aura.cc |
| +++ b/content/browser/renderer_host/web_input_event_aura.cc |
| @@ -10,6 +10,7 @@ namespace content { |
| WebKit::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent( |
| base::NativeEvent native_event); |
| +WebKit::WebMouseEvent MakeWebMouseEventFromAuraEvent(aura::MouseEvent* event); |
| WebKit::WebKeyboardEvent MakeWebKeyboardEventFromNativeEvent( |
| base::NativeEvent native_event); |
| @@ -29,11 +30,20 @@ WebKit::WebKeyboardEvent MakeWebKeyboardEventFromNativeEvent( |
| // aura::Event's base::NativeEvent, and then replace the coordinate fields with |
| // the translated values from the aura::Event. |
| // |
| +// The exception is mouse events on linux. The aura::MouseEvent contains enough |
| +// necessary information to construct a WebMouseEvent. So instead of extracting |
| +// the information from the XEvent, which can be tricky when supporting both |
| +// XInput2 and XInput. |
|
Ben Goodger (Google)
2011/10/19 16:14:20
Can you note that this can be resolved and we can
sadrul
2011/10/19 16:34:37
Done.
|
| +// |
| WebKit::WebMouseEvent MakeWebMouseEvent(aura::MouseEvent* event) { |
| +#if defined(OS_WIN) |
| // Construct an untranslated event from the platform event data. |
| WebKit::WebMouseEvent webkit_event = |
| MakeUntranslatedWebMouseEventFromNativeEvent(event->native_event()); |
| +#else |
| + WebKit::WebMouseEvent webkit_event = MakeWebMouseEventFromAuraEvent(event); |
| +#endif |
| // Replace the event's coordinate fields with translated position data from |
| // |event|. |