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

Unified Diff: chrome/browser/renderer_host/gtk_im_context_wrapper.cc

Issue 7041003: Show composition text on IME panel when Pepper plugin is focused (Linux). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Separated the preedit-needed flag to a different enum. Created 9 years, 6 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: 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

Powered by Google App Engine
This is Rietveld 408576698