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

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

Issue 1267483003: Combine the WM_CHAR with WM_KEY* for key event flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments. Created 5 years, 4 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/remote_input_method_win.cc
diff --git a/ui/base/ime/remote_input_method_win.cc b/ui/base/ime/remote_input_method_win.cc
index 1a589bb0668f6b235b24f755093c2812abd512fb..b15ca13931d08575fbc08ecf3eb8e763f9b6024c 100644
--- a/ui/base/ime/remote_input_method_win.cc
+++ b/ui/base/ime/remote_input_method_win.cc
@@ -183,9 +183,7 @@ class RemoteInputMethodWin : public InputMethod,
if (event->HasNativeEvent()) {
const base::NativeEvent& native_key_event = event->native_event();
if (native_key_event.message == WM_CHAR && text_input_client_) {
- text_input_client_->InsertChar(
- static_cast<base::char16>(native_key_event.wParam),
- ui::GetModifiersFromKeyState());
+ pending_char_events_.push_back(native_key_event);
event->StopPropagation();
}
return;
@@ -200,8 +198,19 @@ class RemoteInputMethodWin : public InputMethod,
event->StopPropagation();
return;
}
- if (delegate_)
+ if (delegate_) {
ignore_result(delegate_->DispatchKeyEventPostIME(event));
+ if (text_input_client_ && pending_char_events_.size()) {
+ for (size_t i = 0; i < pending_char_events_.size(); ++i) {
+ const base::NativeEvent& native_key_event = pending_char_events_[i];
+ text_input_client_->InsertChar(
+ static_cast<base::char16>(pending_char_events_[i].wParam),
+ event->flags());
+ }
+ event->StopPropagation();
+ }
+ }
+ pending_char_events_.clear();
}
void OnTextInputTypeChanged(const TextInputClient* client) override {
@@ -344,6 +353,7 @@ class RemoteInputMethodWin : public InputMethod,
bool is_candidate_popup_open_;
bool is_ime_;
LANGID langid_;
+ std::vector<base::NativeEvent> pending_char_events_;
DISALLOW_COPY_AND_ASSIGN(RemoteInputMethodWin);
};

Powered by Google App Engine
This is Rietveld 408576698