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

Unified Diff: ui/aura/test/event_generator.h

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move to ash/ime/ Created 9 years 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 | « ui/aura/root_window_host_linux.cc ('k') | ui/aura/test/event_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/event_generator.h
diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator.h
index 842b81489f33c408ec1c0df3fe74706bce452d54..80b83b18749a59af288b3d1e7e4c2e79bba54155 100644
--- a/ui/aura/test/event_generator.h
+++ b/ui/aura/test/event_generator.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/gfx/point.h"
namespace aura {
@@ -16,7 +17,6 @@ class Window;
namespace test {
// EventGenerator is a tool that generates and dispatch events.
-// TODO(oshima): Support key events.
class EventGenerator {
public:
// Creates an EventGenerator with the mouse/touch location (0,0).
@@ -93,9 +93,21 @@ class EventGenerator {
// to the center of the window.
void PressMoveAndReleaseTouchToCenterOf(Window* window);
+ // Generates a key press event. On platforms except Windows and X11, a key
+ // event without native_event() is generated.
+ // TODO(yusukes): Support native_event() on all platforms.
+ void PressKey(ui::KeyboardCode key_code, int flags);
+
+ // Generates a key release event. On platforms except Windows and X11, a key
+ // event without native_event() is generated.
+ // TODO(yusukes): Support native_event() on all platforms.
+ void ReleaseKey(ui::KeyboardCode key_code, int flags);
+
private:
- // Dispatch the |event| to the Desktop.
+ // Dispatch the |event| to the RootWindow.
void Dispatch(Event& event);
+ // Dispatch a key event to the RootWindow.
+ void DispatchKeyEvent(bool is_press, ui::KeyboardCode key_code, int flags);
int flags_;
gfx::Point current_location_;
« no previous file with comments | « ui/aura/root_window_host_linux.cc ('k') | ui/aura/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698