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

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

Issue 8342026: Get basic KeyEvents working in RWHVA (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
===================================================================
--- content/browser/renderer_host/web_input_event_aura.cc (revision 106345)
+++ content/browser/renderer_host/web_input_event_aura.cc (working copy)
@@ -8,11 +8,16 @@
namespace content {
+#if defined(OS_WIN)
WebKit::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent(
base::NativeEvent native_event);
-WebKit::WebMouseEvent MakeWebMouseEventFromAuraEvent(aura::MouseEvent* event);
WebKit::WebKeyboardEvent MakeWebKeyboardEventFromNativeEvent(
base::NativeEvent native_event);
+#else
+WebKit::WebMouseEvent MakeWebMouseEventFromAuraEvent(aura::MouseEvent* event);
+WebKit::WebKeyboardEvent MakeWebKeyboardEventFromAuraEvent(
+ aura::KeyEvent* event);
+#endif
// General approach:
//
@@ -59,8 +64,18 @@
}
WebKit::WebKeyboardEvent MakeWebKeyboardEvent(aura::KeyEvent* event) {
+ // Windows can figure out whether or not to construct a RawKeyDown or a Char
+ // WebInputEvent based on the type of message carried in
+ // event->native_event(). X11 is not so fortunate, there is no separate
+ // translated event type, so DesktopHostLinux sends an extra KeyEvent with
+ // is_char() == true. We need to pass the aura::KeyEvent to the X11 function
+ // to detect this case so the right event type can be constructed.
+#if defined(OS_WIN)
// Key events require no translation by the aura system.
return MakeWebKeyboardEventFromNativeEvent(event->native_event());
+#else
+ return MakeWebKeyboardEventFromAuraEvent(event);
+#endif
}
} // namespace content
« 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