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

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

Issue 1257603006: Refactoring for the InputMethod & InputMethodDelegate interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Sadrul's comment. 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
« no previous file with comments | « ui/base/ime/mock_input_method.cc ('k') | ui/base/ime/remote_input_method_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5f8c0e71bc57cd07d07d7043027809dc5775a87f..1a589bb0668f6b235b24f755093c2812abd512fb 100644
--- a/ui/base/ime/remote_input_method_win.cc
+++ b/ui/base/ime/remote_input_method_win.cc
@@ -179,30 +179,29 @@ class RemoteInputMethodWin : public InputMethod,
return text_input_client_;
}
- bool DispatchKeyEvent(const ui::KeyEvent& event) override {
- if (event.HasNativeEvent()) {
- const base::NativeEvent& native_key_event = event.native_event();
- if (native_key_event.message != WM_CHAR)
- return false;
- if (!text_input_client_)
- return false;
- text_input_client_->InsertChar(
- static_cast<base::char16>(native_key_event.wParam),
- ui::GetModifiersFromKeyState());
- return true;
+ void DispatchKeyEvent(ui::KeyEvent* event) override {
+ 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());
+ event->StopPropagation();
+ }
+ return;
}
- if (event.is_char()) {
+ if (event->is_char()) {
if (text_input_client_) {
text_input_client_->InsertChar(
- event.GetCharacter(),
+ event->GetCharacter(),
ui::GetModifiersFromKeyState());
}
- return true;
+ event->StopPropagation();
+ return;
}
- if (!delegate_)
- return false;
- return delegate_->DispatchKeyEventPostIME(event);
+ if (delegate_)
+ ignore_result(delegate_->DispatchKeyEventPostIME(event));
}
void OnTextInputTypeChanged(const TextInputClient* client) override {
« no previous file with comments | « ui/base/ime/mock_input_method.cc ('k') | ui/base/ime/remote_input_method_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698