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

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

Issue 1771173002: Implement input.ime.sendKeyEvents API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure. 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
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_win.cc
diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc
index 0bc905297b0fed47d3e77b3dd69a238b7f81a0d6..9b04a8d454302406bdd58d88c92b3df35e016238 100644
--- a/ui/base/ime/input_method_win.cc
+++ b/ui/base/ime/input_method_win.cc
@@ -623,15 +623,16 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const {
}
void InputMethodWin::DispatchFabricatedKeyEvent(ui::KeyEvent* event) {
- if (event->is_char()) {
- if (GetTextInputClient()) {
- ui::KeyEvent ch_event(*event);
- ch_event.set_character(static_cast<base::char16>(event->key_code()));
- GetTextInputClient()->InsertChar(ch_event);
- return;
- }
+ // The key event if from calling input.ime.sendKeyEvent or test.
+ ui::EventDispatchDetails details = DispatchKeyEventPostIME(event);
+ if (details.dispatcher_destroyed || details.target_destroyed ||
+ event->stopped_propagation()) {
+ return;
}
- ignore_result(DispatchKeyEventPostIME(event));
+
+ if ((event->is_char() || event->GetDomKey().IsCharacter()) &&
+ event->type() == ui::ET_KEY_PRESSED && GetTextInputClient())
+ GetTextInputClient()->InsertChar(*event);
}
void InputMethodWin::ConfirmCompositionText() {
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698