Commit e1703185 authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Fix possible crash in keyboard::SendKeyEvent().

Bug: 750526
Change-Id: Id8a2dd90b835279e6dc39de493e174c563bf7493
Reviewed-on: https://chromium-review.googlesource.com/892682
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Reviewed-by: default avatarBlake O'Hare <blakeo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533190}
parent 694c17b5
......@@ -245,12 +245,14 @@ bool SendKeyEvent(const std::string type,
if (!input_method)
return false;
// This can be null if no text input field is not focused.
ui::TextInputClient* tic = input_method->GetTextInputClient();
SendProcessKeyEvent(ui::ET_KEY_PRESSED, host);
ui::KeyEvent char_event(key_value, code, ui::EF_NONE);
tic->InsertChar(char_event);
if (tic)
tic->InsertChar(char_event);
SendProcessKeyEvent(ui::ET_KEY_RELEASED, host);
}
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment