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

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

Issue 98283002: Remove code checking whether native_event or not. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_ibus.cc
diff --git a/ui/base/ime/input_method_ibus.cc b/ui/base/ime/input_method_ibus.cc
index d120c5801aab2d4b368a16e892b943545e23d32f..eeb7a083b5e72b8bd5615367d76230226d0c8751 100644
--- a/ui/base/ime/input_method_ibus.cc
+++ b/ui/base/ime/input_method_ibus.cc
@@ -88,17 +88,10 @@ bool InputMethodIBus::OnUntranslatedIMEMessage(const base::NativeEvent& event,
void InputMethodIBus::ProcessKeyEventDone(uint32 id,
ui::KeyEvent* event,
bool is_handled) {
- DCHECK(event);
-
- // TODO(komatsu): Support fabricated key events.
- if (!event->HasNativeEvent())
- return;
-
- std::set<uint32>::iterator it = pending_key_events_.find(id);
-
- if (it == pending_key_events_.end())
+ if (pending_key_events_.find(id) == pending_key_events_.end())
return; // Abandoned key event.
+ DCHECK(event);
if (event->type() == ET_KEY_PRESSED) {
if (is_handled) {
// IME event has a priority to be handled, so that character composer
@@ -114,8 +107,7 @@ void InputMethodIBus::ProcessKeyEventDone(uint32 id,
if (event->type() == ET_KEY_PRESSED || event->type() == ET_KEY_RELEASED)
ProcessKeyEventPostIME(*event, is_handled);
- // Do not use |it| for erasing, ProcessKeyEventPostIME may change the
- // |pending_key_events_|.
+ // ProcessKeyEventPostIME may change the |pending_key_events_|.
pending_key_events_.erase(id);
}
@@ -362,12 +354,7 @@ void InputMethodIBus::UpdateContextFocusState() {
void InputMethodIBus::ProcessKeyEventPostIME(
const ui::KeyEvent& event,
bool handled) {
- // TODO(komatsu): Support fabricated key events.
- if (!event.HasNativeEvent())
- return;
-
TextInputClient* client = GetTextInputClient();
-
if (!client) {
// As ibus works asynchronously, there is a chance that the focused client
// loses focus before this method gets called.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698