Index: chrome/browser/renderer_host/render_widget_host_view_gtk.h |
=================================================================== |
--- chrome/browser/renderer_host/render_widget_host_view_gtk.h (revision 18994) |
+++ chrome/browser/renderer_host/render_widget_host_view_gtk.h (working copy) |
@@ -18,6 +18,7 @@ |
typedef struct _GtkClipboard GtkClipboard; |
typedef struct _GtkSelectionData GtkSelectionData; |
+typedef struct _GtkIMContext GtkIMContext; |
// ----------------------------------------------------------------------------- |
// See comments in render_widget_host_view.h about this class and its members. |
@@ -109,6 +110,28 @@ |
// We ignore the first mouse release on popups. This allows the popup to |
// stay open. |
bool is_popup_first_mouse_release_; |
+ |
+ // The GtkIMContext object. |
+ // In terms of the DOM event specification Appendix A |
+ // <http://www.w3.org/TR/DOM-Level-3-Events/keyset.html>, |
+ // GTK uses a GtkIMContext object for the following two purposes: |
+ // 1. Composing Latin characters (A.1.2), and; |
+ // 2. Composing CJK characters with an IME (A.1.3). |
+ // Many JavaScript pages assume composed Latin characters are dispatched to |
+ // their onkeypress() handlers but not dispatched CJK characters composed |
+ // with an IME. To emulate this behavior, we should monitor the status of |
+ // this GtkIMContext object and prevent sending Char events when a |
+ // GtkIMContext object sends a "commit" signal with the CJK characters |
+ // composed by an IME. |
+ GtkIMContext* im_context_; |
+ |
+ // Whether or not the above GtkIMContext is composing a CJK text with an IME. |
+ // The GtkIMContext object sends a "preedit_start" before it starts composing |
+ // a CJK text and a "preedit_end" signal after it finishes composing it. |
+ // On the other hand, the GtkIMContext object doesn't send them when |
+ // composing Latin texts. So, we monitor the above signals to check whether |
+ // or not the GtkIMContext object is composing a CJK text. |
+ bool im_is_composing_cjk_text_; |
}; |
#endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ |