Index: chrome/browser/renderer_host/gtk_im_context_wrapper.cc |
diff --git a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc |
index fc46a9861fb2dac3feec2e416bb67b7ace7bee9f..f437d4475ccdbf4adb1e52b5a2aa48c88c8af0e5 100644 |
--- a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc |
+++ b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc |
@@ -225,8 +225,10 @@ void GtkIMContextWrapper::ProcessKeyEvent(GdkEventKey* event) { |
last_key_filtered_no_result_ = (filtered && !has_result); |
} |
-void GtkIMContextWrapper::UpdateInputMethodState(WebKit::WebTextInputType type, |
- const gfx::Rect& caret_rect) { |
+void GtkIMContextWrapper::UpdateInputMethodState( |
+ ui::TextInputType type, |
+ ui::TextInputPreeditType preedit_type, |
+ const gfx::Rect& caret_rect) { |
suppress_next_commit_ = false; |
// The renderer has updated its IME status. |
@@ -236,7 +238,7 @@ void GtkIMContextWrapper::UpdateInputMethodState(WebKit::WebTextInputType type, |
DCHECK(!is_in_key_event_handler_); |
- bool is_enabled = (type == WebKit::WebTextInputTypeText); |
+ bool is_enabled = (type == ui::TEXT_INPUT_TYPE_TEXT); |
if (is_enabled_ != is_enabled) { |
is_enabled_ = is_enabled; |
if (is_enabled) |
@@ -246,6 +248,11 @@ void GtkIMContextWrapper::UpdateInputMethodState(WebKit::WebTextInputType type, |
} |
if (is_enabled) { |
+ // If the focused element requests normal IME, turns on to the mode |
+ // receiving preedit messages. Otherwise, do not receive the messages |
+ // and candidate window should take care of preedits. |
+ bool context_use_preedit = preedit_type == ui::TEXT_INPUT_PREEDIT_INLINE; |
+ gtk_im_context_set_use_preedit(context_, context_use_preedit); |
// Updates the position of the IME candidate window. |
// The position sent from the renderer is a relative one, so we need to |
// attach the GtkIMContext object to this window before changing the |