| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include <gdk/gdk.h> | 8 #include <gdk/gdk.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/gfx/native_widget_types.h" | 11 #include "base/gfx/native_widget_types.h" |
| 12 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 12 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 13 #include "chrome/common/owned_widget_gtk.h" | 13 #include "chrome/common/owned_widget_gtk.h" |
| 14 #include "chrome/common/render_messages.h" | 14 #include "chrome/common/render_messages.h" |
| 15 #include "webkit/glue/webcursor.h" | 15 #include "webkit/glue/webcursor.h" |
| 16 | 16 |
| 17 class RenderWidgetHost; | 17 class RenderWidgetHost; |
| 18 | 18 |
| 19 typedef struct _GtkClipboard GtkClipboard; | 19 typedef struct _GtkClipboard GtkClipboard; |
| 20 typedef struct _GtkSelectionData GtkSelectionData; | 20 typedef struct _GtkSelectionData GtkSelectionData; |
| 21 typedef struct _GtkIMContext GtkIMContext; | |
| 22 | 21 |
| 23 // ----------------------------------------------------------------------------- | 22 // ----------------------------------------------------------------------------- |
| 24 // See comments in render_widget_host_view.h about this class and its members. | 23 // See comments in render_widget_host_view.h about this class and its members. |
| 25 // ----------------------------------------------------------------------------- | 24 // ----------------------------------------------------------------------------- |
| 26 class RenderWidgetHostViewGtk : public RenderWidgetHostView { | 25 class RenderWidgetHostViewGtk : public RenderWidgetHostView { |
| 27 public: | 26 public: |
| 28 RenderWidgetHostViewGtk(RenderWidgetHost* widget); | 27 RenderWidgetHostViewGtk(RenderWidgetHost* widget); |
| 29 ~RenderWidgetHostViewGtk(); | 28 ~RenderWidgetHostViewGtk(); |
| 30 | 29 |
| 31 // Initialize this object for use as a drawing area. | 30 // Initialize this object for use as a drawing area. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 102 |
| 104 // Variables used only for popups -------------------------------------------- | 103 // Variables used only for popups -------------------------------------------- |
| 105 // Our parent widget. | 104 // Our parent widget. |
| 106 RenderWidgetHostView* parent_host_view_; | 105 RenderWidgetHostView* parent_host_view_; |
| 107 // The native view of our parent, equivalent to | 106 // The native view of our parent, equivalent to |
| 108 // parent_host_view_->GetNativeView(). | 107 // parent_host_view_->GetNativeView(). |
| 109 GtkWidget* parent_; | 108 GtkWidget* parent_; |
| 110 // We ignore the first mouse release on popups. This allows the popup to | 109 // We ignore the first mouse release on popups. This allows the popup to |
| 111 // stay open. | 110 // stay open. |
| 112 bool is_popup_first_mouse_release_; | 111 bool is_popup_first_mouse_release_; |
| 113 | |
| 114 // The GtkIMContext object. | |
| 115 // In terms of the DOM event specification Appendix A | |
| 116 // <http://www.w3.org/TR/DOM-Level-3-Events/keyset.html>, | |
| 117 // GTK uses a GtkIMContext object for the following two purposes: | |
| 118 // 1. Composing Latin characters (A.1.2), and; | |
| 119 // 2. Composing CJK characters with an IME (A.1.3). | |
| 120 // Many JavaScript pages assume composed Latin characters are dispatched to | |
| 121 // their onkeypress() handlers but not dispatched CJK characters composed | |
| 122 // with an IME. To emulate this behavior, we should monitor the status of | |
| 123 // this GtkIMContext object and prevent sending Char events when a | |
| 124 // GtkIMContext object sends a "commit" signal with the CJK characters | |
| 125 // composed by an IME. | |
| 126 GtkIMContext* im_context_; | |
| 127 | |
| 128 // Whether or not the above GtkIMContext is composing a CJK text with an IME. | |
| 129 // The GtkIMContext object sends a "preedit_start" before it starts composing | |
| 130 // a CJK text and a "preedit_end" signal after it finishes composing it. | |
| 131 // On the other hand, the GtkIMContext object doesn't send them when | |
| 132 // composing Latin texts. So, we monitor the above signals to check whether | |
| 133 // or not the GtkIMContext object is composing a CJK text. | |
| 134 bool im_is_composing_cjk_text_; | |
| 135 }; | 112 }; |
| 136 | 113 |
| 137 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ | 114 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ |
| OLD | NEW |