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

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: 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
« ui/base/ime/input_method_auralinux.cc ('K') | « ui/base/ime/input_method_base.cc ('k') | no next file » | 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 80a680565e10eee4d551a4aff1f79f5ad9d7fe75..e79804c54b635b4a0e03e55fb9a1afaf2da8ca85 100644
--- a/ui/base/ime/input_method_win.cc
+++ b/ui/base/ime/input_method_win.cc
@@ -619,15 +619,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() {
« ui/base/ime/input_method_auralinux.cc ('K') | « ui/base/ime/input_method_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698