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

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: A todo comment is reworded to be more correct. 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..4df6eb82bd955888fd9fe61c134b50bdc8ff51ba 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,
+ bool can_compose_inline,
+ 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,10 @@ void GtkIMContextWrapper::UpdateInputMethodState(WebKit::WebTextInputType type,
}
if (is_enabled) {
+ // If the focused element supports inline rendering of composition text,
+ // we receive and send related events to it. Otherwise, the events related
+ // to the updates of composition text are directed to the candidate window.
+ gtk_im_context_set_use_preedit(context_, can_compose_inline);
// 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
« no previous file with comments | « chrome/browser/renderer_host/gtk_im_context_wrapper.h ('k') | chrome/browser/renderer_host/render_widget_host_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698