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

Side by Side Diff: ui/aura/desktop_host_linux.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/web_input_event_aurax11.cc ('k') | ui/aura/desktop_host_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/desktop_host.h" 5 #include "ui/aura/desktop_host.h"
6 6
7 #include <X11/cursorfont.h> 7 #include <X11/cursorfont.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 179
180 base::MessagePumpDispatcher::DispatchStatus DesktopHostLinux::Dispatch( 180 base::MessagePumpDispatcher::DispatchStatus DesktopHostLinux::Dispatch(
181 XEvent* xev) { 181 XEvent* xev) {
182 bool handled = false; 182 bool handled = false;
183 switch (xev->type) { 183 switch (xev->type) {
184 case Expose: 184 case Expose:
185 desktop_->Draw(); 185 desktop_->Draw();
186 handled = true; 186 handled = true;
187 break; 187 break;
188 case KeyPress: 188 case KeyPress: {
189 KeyEvent keydown_event(xev, false);
190 handled = desktop_->OnKeyEvent(keydown_event);
191 KeyEvent char_event(xev, true);
192 handled |= desktop_->OnKeyEvent(char_event);
193 break;
194 }
189 case KeyRelease: { 195 case KeyRelease: {
190 KeyEvent keyev(xev); 196 KeyEvent keyup_event(xev, false);
191 handled = desktop_->OnKeyEvent(keyev); 197 handled = desktop_->OnKeyEvent(keyup_event);
192 break; 198 break;
193 } 199 }
194 case ButtonPress: 200 case ButtonPress:
195 case ButtonRelease: { 201 case ButtonRelease: {
196 MouseEvent mouseev(xev); 202 MouseEvent mouseev(xev);
197 handled = desktop_->OnMouseEvent(mouseev); 203 handled = desktop_->OnMouseEvent(mouseev);
198 break; 204 break;
199 } 205 }
200 case MotionNotify: { 206 case MotionNotify: {
201 // Discard all but the most recent motion event that targets the same 207 // Discard all but the most recent motion event that targets the same
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 327 }
322 328
323 } // namespace 329 } // namespace
324 330
325 // static 331 // static
326 DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) { 332 DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) {
327 return new DesktopHostLinux(bounds); 333 return new DesktopHostLinux(bounds);
328 } 334 }
329 335
330 } // namespace aura 336 } // namespace aura
OLDNEW
« no previous file with comments | « content/browser/renderer_host/web_input_event_aurax11.cc ('k') | ui/aura/desktop_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698