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

Unified Diff: components/test_runner/text_input_controller.cc

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Rebase Created 3 years, 12 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
Index: components/test_runner/text_input_controller.cc
diff --git a/components/test_runner/text_input_controller.cc b/components/test_runner/text_input_controller.cc
index a57e65734b123e906446b89b8bac5c9a5cc420c6..5a94e7845ebb44d993efaf1221bb448efae3e672 100644
--- a/components/test_runner/text_input_controller.cc
+++ b/components/test_runner/text_input_controller.cc
@@ -21,6 +21,7 @@
#include "third_party/WebKit/public/web/WebRange.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/events/base_event_utils.h"
#include "v8/include/v8.h"
namespace test_runner {
@@ -293,9 +294,10 @@ std::vector<int> TextInputController::FirstRectForCharacterRange(
void TextInputController::SetComposition(const std::string& text) {
// Sends a keydown event with key code = 0xE5 to emulate input method
// behavior.
- blink::WebKeyboardEvent key_down;
- key_down.type = blink::WebInputEvent::RawKeyDown;
- key_down.modifiers = 0;
+ blink::WebKeyboardEvent key_down(
+ blink::WebInputEvent::RawKeyDown, blink::WebInputEvent::NoModifiers,
+ ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
+
key_down.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY
view()->handleInputEvent(key_down);

Powered by Google App Engine
This is Rietveld 408576698