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

Unified Diff: ui/aura/desktop_host_linux.cc

Issue 8417008: aura: Add fullscreen/popups to RenderWidgetHostViewAura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avoid passing unneeded parameters. um. 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 | « content/browser/renderer_host/web_input_event_aura.cc ('k') | ui/gfx/compositor/compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/desktop_host_linux.cc
diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc
index 6d2b4fa0bfab27eff0791fe31be0e6a4a6c537c1..7b4e792fd0a2c9e59768e843e6a73b45910c92a1 100644
--- a/ui/aura/desktop_host_linux.cc
+++ b/ui/aura/desktop_host_linux.cc
@@ -17,6 +17,7 @@
#include "ui/aura/cursor.h"
#include "ui/aura/desktop.h"
#include "ui/aura/event.h"
+#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/touch/touch_factory.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/compositor/layer.h"
@@ -180,6 +181,19 @@ int CoalescePendingXIMotionEvents(const XEvent* xev, XEvent* last_event) {
return num_coalesed;
}
+// We emulate Windows' WM_KEYDOWN and WM_CHAR messages. WM_CHAR events are only
+// generated for certain keys; see
+// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646268(v=vs.85).aspx
+bool ShouldSendCharEventForKeyboardCode(ui::KeyboardCode keycode) {
Hironori Bono 2011/10/28 05:10:12 nit: we also need true when we type graphic-charac
+ return (keycode >= ui::VKEY_0 && keycode <= ui::VKEY_9) ||
+ (keycode >= ui::VKEY_A && keycode <= ui::VKEY_Z) ||
+ keycode == ui::VKEY_BACK ||
+ keycode == ui::VKEY_RETURN ||
+ keycode == ui::VKEY_ESCAPE ||
+ // TODO: SHIFT+ENTER (linefeed)?
+ keycode == ui::VKEY_TAB;
+}
+
class DesktopHostLinux : public DesktopHost {
public:
explicit DesktopHostLinux(const gfx::Rect& bounds);
@@ -256,8 +270,10 @@ base::MessagePumpDispatcher::DispatchStatus DesktopHostLinux::Dispatch(
case KeyPress: {
KeyEvent keydown_event(xev, false);
handled = desktop_->DispatchKeyEvent(&keydown_event);
- KeyEvent char_event(xev, true);
- handled |= desktop_->DispatchKeyEvent(&char_event);
+ if (ShouldSendCharEventForKeyboardCode(keydown_event.key_code())) {
+ KeyEvent char_event(xev, true);
+ handled |= desktop_->DispatchKeyEvent(&char_event);
+ }
break;
}
case KeyRelease: {
« no previous file with comments | « content/browser/renderer_host/web_input_event_aura.cc ('k') | ui/gfx/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698