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

Unified Diff: content/browser/renderer_host/web_input_event_aura.cc

Issue 8353005: aura: Make keyevents for renderers work correctly in X11. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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/web_input_event_aurax11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bbadb7c2248312bda97ded8fe956696687dad50d 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,21 @@ 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, the WebMouseEvent is constructed from the
+// aura::MouseEvent. This will not be necessary once only XInput2 is supported.
+//
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|.
« no previous file with comments | « no previous file | content/browser/renderer_host/web_input_event_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698