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

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: 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..65838ee17490a0b0fbc8e863d552b9deb858e6af 100644
--- a/ui/base/ime/remote_input_method_win.cc
+++ b/ui/base/ime/remote_input_method_win.cc
@@ -200,8 +200,17 @@ 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) {
+ text_input_client_->InsertChar(
+ pending_char_events_[i], event->flags());
+ }
+ event->StopPropagation();
+ }
+ }
+ pending_char_events_.clear();
}
void OnTextInputTypeChanged(const TextInputClient* client) override {
@@ -326,6 +335,10 @@ class RemoteInputMethodWin : public InputMethod,
text_input_client_->InsertText(text);
}
+ void OnCharForNextKeyEvent(base::char16 ch) override {
+ pending_char_events_.push_back(ch);
+ }
+
bool CanSendRemoteNotification(
const TextInputClient* text_input_client) const {
return text_input_client_ &&
@@ -344,6 +357,7 @@ class RemoteInputMethodWin : public InputMethod,
bool is_candidate_popup_open_;
bool is_ime_;
LANGID langid_;
+ std::vector<base::char16> pending_char_events_;
DISALLOW_COPY_AND_ASSIGN(RemoteInputMethodWin);
};

Powered by Google App Engine
This is Rietveld 408576698