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

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

Issue 22909048: Remove IBus specific hack from InputMethodIBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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_ibus.h ('k') | 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 70b05f0f3e5a0e155168d0982e37153dac918ad6..0064ce3ce6ac4b92c56ad5a5e95ef438a73f5279 100644
--- a/ui/base/ime/input_method_ibus.cc
+++ b/ui/base/ime/input_method_ibus.cc
@@ -91,7 +91,6 @@ InputMethodIBus::InputMethodIBus(
context_focused_(false),
composing_text_(false),
composition_changed_(false),
- suppress_next_result_(false),
current_keyevent_id_(0),
weak_ptr_factory_(this) {
SetDelegate(delegate);
@@ -233,10 +232,6 @@ bool InputMethodIBus::DispatchKeyEvent(const base::NativeEvent& native_event) {
callback,
base::Bind(callback, false));
++current_keyevent_id_;
-
- // We don't want to suppress the result generated by this key event, but it
- // may cause problem. See comment in ResetContext() method.
- suppress_next_result_ = false;
return true;
}
@@ -429,16 +424,6 @@ void InputMethodIBus::ResetContext() {
DCHECK(system_toplevel_window_focused());
- // Because ibus runs in asynchronous mode, the input method may still send us
- // results after sending out the reset request, so we use a flag to discard
- // all results generated by previous key events. But because ibus does not
- // have a mechanism to identify each key event and corresponding results, this
- // approach will not work for some corner cases. For example if the user types
- // very fast, then the next key event may come in before the |context_| is
- // really reset. Then we actually cannot know whether or not the next
- // result should be discard.
- suppress_next_result_ = true;
-
composition_.Clear();
result_text_.clear();
composing_text_ = false;
@@ -667,7 +652,7 @@ void InputMethodIBus::AbandonAllPendingKeyEvents() {
}
void InputMethodIBus::CommitText(const chromeos::IBusText& text) {
- if (suppress_next_result_ || text.text().empty())
+ if (text.text().empty())
return;
// We need to receive input method result even if the text input type is
@@ -719,7 +704,7 @@ void InputMethodIBus::ForwardKeyEvent(uint32 keyval,
}
void InputMethodIBus::ShowPreeditText() {
- if (suppress_next_result_ || IsTextInputTypeNone())
+ if (IsTextInputTypeNone())
return;
composing_text_ = true;
@@ -728,7 +713,7 @@ void InputMethodIBus::ShowPreeditText() {
void InputMethodIBus::UpdatePreeditText(const chromeos::IBusText& text,
uint32 cursor_pos,
bool visible) {
- if (suppress_next_result_ || IsTextInputTypeNone())
+ if (IsTextInputTypeNone())
return;
// |visible| argument is very confusing. For example, what's the correct
@@ -860,7 +845,6 @@ bool InputMethodIBus::ExecuteCharacterComposer(uint32 ibus_keyval,
ibus_keycode,
EventFlagsFromXState(ibus_state));
- suppress_next_result_ = false;
chromeos::IBusText preedit;
preedit.set_text(
UTF16ToUTF8(character_composer_.preedit_string()));
« no previous file with comments | « ui/base/ime/input_method_ibus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698