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

Unified Diff: ui/base/ime/input_method_auralinux.cc

Issue 1771173002: Implement input.ime.sendKeyEvents API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the json file. Created 4 years, 9 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: ui/base/ime/input_method_auralinux.cc
diff --git a/ui/base/ime/input_method_auralinux.cc b/ui/base/ime/input_method_auralinux.cc
index 6e26c94293718cf33e8cb3b2b03dbb63f2b43e83..59280304ee440c04c4a9b52edfbbbd1af6d75fa2 100644
--- a/ui/base/ime/input_method_auralinux.cc
+++ b/ui/base/ime/input_method_auralinux.cc
@@ -65,6 +65,20 @@ void InputMethodAuraLinux::DispatchKeyEvent(ui::KeyEvent* event) {
return;
}
+ if (!event->HasNativeEvent()) {
+ // Faked key events that are sent from input.ime.sendKeyEvents.
+ ui::EventDispatchDetails details = DispatchKeyEventPostIME(event);
+ if (details.dispatcher_destroyed || details.target_destroyed ||
+ event->stopped_propagation()) {
+ return;
+ }
+ if ((event->is_char() || event->GetDomKey().IsCharacter()) &&
+ event->type() == ui::ET_KEY_PRESSED) {
+ GetTextInputClient()->InsertChar(*event);
+ }
+ return;
Devlin 2016/03/14 22:32:01 don't need this return
Azure Wei 2016/03/15 00:37:25 This 'return' is necessary to prevent the function
+ }
+
suppress_next_result_ = false;
composition_changed_ = false;
result_text_.clear();

Powered by Google App Engine
This is Rietveld 408576698