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

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: review fixes 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
Index: ui/aura/test/event_generator.h
diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator.h
index e81096469c60fad35a88705064057aff1249ec2e..5be5b317a7ec05d6c8ce26b5a38d9bb15cac10e8 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 location (0,0).
@@ -69,9 +69,21 @@ class EventGenerator {
// Generates events to move the mouse to the center of the window.
void MoveMouseToCenterOf(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_;

Powered by Google App Engine
This is Rietveld 408576698