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

Unified Diff: ui/base/ime/input_method_minimal.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/input_method_minimal.h ('k') | ui/base/ime/input_method_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_minimal.cc
diff --git a/ui/base/ime/input_method_minimal.cc b/ui/base/ime/input_method_minimal.cc
index 47d8cec0fb0be232644badb219decf64cdb6ba85..cd00702111f7b10b81d8f32304c96c727d80314c 100644
--- a/ui/base/ime/input_method_minimal.cc
+++ b/ui/base/ime/input_method_minimal.cc
@@ -23,23 +23,24 @@ bool InputMethodMinimal::OnUntranslatedIMEMessage(
return false;
}
-bool InputMethodMinimal::DispatchKeyEvent(const ui::KeyEvent& event) {
- DCHECK(event.type() == ET_KEY_PRESSED || event.type() == ET_KEY_RELEASED);
+void InputMethodMinimal::DispatchKeyEvent(ui::KeyEvent* event) {
+ DCHECK(event->type() == ET_KEY_PRESSED || event->type() == ET_KEY_RELEASED);
// If no text input client, do nothing.
- if (!GetTextInputClient())
- return DispatchKeyEventPostIME(event);
+ if (!GetTextInputClient()) {
+ ignore_result(DispatchKeyEventPostIME(event));
+ return;
+ }
// Insert the character.
- const bool handled = DispatchKeyEventPostIME(event);
- if (event.type() == ET_KEY_PRESSED && GetTextInputClient()) {
- const uint16 ch = event.GetCharacter();
+ ignore_result(DispatchKeyEventPostIME(event));
+ if (event->type() == ET_KEY_PRESSED && GetTextInputClient()) {
+ const uint16 ch = event->GetCharacter();
if (ch) {
- GetTextInputClient()->InsertChar(ch, event.flags());
- return true;
+ GetTextInputClient()->InsertChar(ch, event->flags());
+ event->StopPropagation();
}
}
- return handled;
}
void InputMethodMinimal::OnCaretBoundsChanged(const TextInputClient* client) {}
« no previous file with comments | « ui/base/ime/input_method_minimal.h ('k') | ui/base/ime/input_method_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698