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

Unified Diff: views/ime/input_method_ibus.cc

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor X2Event handling, nix Windows InputMethodDelegate, etc. Created 9 years, 8 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: views/ime/input_method_ibus.cc
diff --git a/views/ime/input_method_ibus.cc b/views/ime/input_method_ibus.cc
index 406554e01738b241c2fde4492c5afa0abd3f8188..b314eccf031ade82d8f236a43c131126c372371c 100644
--- a/views/ime/input_method_ibus.cc
+++ b/views/ime/input_method_ibus.cc
@@ -309,7 +309,7 @@ void InputMethodIBus::Init(Widget* widget) {
CreateContext();
}
-void InputMethodIBus::DispatchKeyEvent(const KeyEvent& key) {
+bool InputMethodIBus::OnKeyEvent(const KeyEvent& key) {
DCHECK(key.type() == ui::ET_KEY_PRESSED || key.type() == ui::ET_KEY_RELEASED);
DCHECK(widget_focused());
@@ -321,11 +321,11 @@ void InputMethodIBus::DispatchKeyEvent(const KeyEvent& key) {
// enabled, so that ibus can have a chance to enable the |context_|.
if (!(context_focused_ || fake_context_) ||
GetTextInputType() == ui::TEXT_INPUT_TYPE_PASSWORD) {
- if (key.type() == ui::ET_KEY_PRESSED)
+ if (key.type() == ui::ET_KEY_PRESSED) {
ProcessUnfilteredKeyPressEvent(key);
- else
- DispatchKeyEventPostIME(key);
- return;
+ return true;
+ }
+ return false;
}
guint32 ibus_keyval = 0;
@@ -360,6 +360,8 @@ void InputMethodIBus::DispatchKeyEvent(const KeyEvent& key) {
// 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;
}
void InputMethodIBus::OnTextInputTypeChanged(View* view) {

Powered by Google App Engine
This is Rietveld 408576698