diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-09-02 14:22:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-09-05 20:21:00 +0000 |
commit | 7d2c5d177e9813077a621df8d18c0deda73099b3 (patch) | |
tree | 88ad4850908e124d4f5d59f2bca571d63df34bf7 /chromium/ui/base/ime | |
parent | c5dbcb143405a38088d78b4b760d64aaff5157ab (diff) | |
download | qtwebengine-chromium-7d2c5d177e9813077a621df8d18c0deda73099b3.tar.gz |
BASELINE: Update Chromium to 102.0.5005.177
Change-Id: I0229f2402b8321f58c0092ec81d63372bec7e789
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/ui/base/ime')
-rw-r--r-- | chromium/ui/base/ime/ash/input_method_ash.cc | 11 | ||||
-rw-r--r-- | chromium/ui/base/ime/ash/input_method_ash_unittest.cc | 6 | ||||
-rw-r--r-- | chromium/ui/base/ime/fuchsia/keyboard_client.cc | 5 |
3 files changed, 14 insertions, 8 deletions
diff --git a/chromium/ui/base/ime/ash/input_method_ash.cc b/chromium/ui/base/ime/ash/input_method_ash.cc index 05c334e6078..ed669c21a27 100644 --- a/chromium/ui/base/ime/ash/input_method_ash.cc +++ b/chromium/ui/base/ime/ash/input_method_ash.cc @@ -646,9 +646,16 @@ void InputMethodAsh::MaybeProcessPendingInputMethodResult(ui::KeyEvent* event, DCHECK(client); if (pending_commit_) { - if (pending_commit_->text.empty()) { + if (handled && NeedInsertChar()) { + for (const auto& ch : pending_commit_->text) { + KeyEvent ch_event(ET_KEY_PRESSED, VKEY_UNKNOWN, EF_NONE); + ch_event.set_character(ch); + client->InsertChar(ch_event); + } + } else if (pending_commit_->text.empty()) { client->InsertText( u"", TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText); + composing_text_ = false; } else { // Split the commit into two separate commits, one for the substring // before the cursor and one for the substring after. @@ -666,8 +673,8 @@ void InputMethodAsh::MaybeProcessPendingInputMethodResult(ui::KeyEvent* event, after_cursor, TextInputClient::InsertTextCursorBehavior::kMoveCursorBeforeText); } + composing_text_ = false; } - composing_text_ = false; typing_session_manager_.CommitCharacters(pending_commit_->text.length()); } diff --git a/chromium/ui/base/ime/ash/input_method_ash_unittest.cc b/chromium/ui/base/ime/ash/input_method_ash_unittest.cc index e97a691e1c9..e943f986f6e 100644 --- a/chromium/ui/base/ime/ash/input_method_ash_unittest.cc +++ b/chromium/ui/base/ime/ash/input_method_ash_unittest.cc @@ -1005,7 +1005,7 @@ TEST_F(InputMethodAshKeyEventTest, KeyEventDelayResponseTest) { u"A", TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText); - EXPECT_EQ(u"", inserted_text_); + EXPECT_EQ(0, inserted_char_); // Do callback. std::move(mock_ime_engine_handler_->last_passed_callback()).Run(true); @@ -1018,7 +1018,7 @@ TEST_F(InputMethodAshKeyEventTest, KeyEventDelayResponseTest) { EXPECT_EQ(kFlags, stored_event.flags()); EXPECT_TRUE(ime_->process_key_event_post_ime_args().handled); - EXPECT_EQ(u"A", inserted_text_); + EXPECT_EQ(L'A', inserted_char_); } TEST_F(InputMethodAshKeyEventTest, MultiKeyEventDelayResponseTest) { @@ -1185,7 +1185,7 @@ TEST_F(InputMethodAshKeyEventTest, SetAutocorrectRangeRunsAfterCommitText) { std::move(mock_ime_engine_handler_->last_passed_callback()) .Run(/*handled=*/true); - EXPECT_EQ(u"a", inserted_text_); + EXPECT_EQ(L'a', inserted_char_); EXPECT_EQ(gfx::Range(0, 1), GetAutocorrectRange()); } diff --git a/chromium/ui/base/ime/fuchsia/keyboard_client.cc b/chromium/ui/base/ime/fuchsia/keyboard_client.cc index 4570ffdf27b..c70f72ca90d 100644 --- a/chromium/ui/base/ime/fuchsia/keyboard_client.cc +++ b/chromium/ui/base/ime/fuchsia/keyboard_client.cc @@ -160,13 +160,12 @@ absl::optional<ui::KeyEvent> KeyboardClient::ConvertKeystrokeEvent( // TODO(https://crbug.com/1187257): Use input3.KeyMeaning instead of US layout // as the default. - DomCode dom_code = - KeycodeConverter::UsbKeycodeToDomCode(static_cast<int>(key_event.key())); + DomCode dom_code = KeycodeConverter::UsbKeycodeToDomCode(key_event.key()); DomKey dom_key; KeyboardCode key_code; if (!DomCodeToUsLayoutDomKey(dom_code, event_flags, &dom_key, &key_code)) { LOG(ERROR) << "DomCodeToUsLayoutDomKey() failed for key: " - << static_cast<uint32_t>(key_event.key()); + << key_event.key(); } return ui::KeyEvent(*event_type, key_code, dom_code, event_flags, dom_key, |