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/plugins/gtk_plugin_container_host.h" |
15 #include "webkit/glue/webcursor.h" | 16 #include "webkit/glue/webcursor.h" |
16 | 17 |
17 class RenderWidgetHost; | 18 class RenderWidgetHost; |
| 19 class GtkPluginContainerHost; |
18 | 20 |
19 typedef struct _GtkClipboard GtkClipboard; | 21 typedef struct _GtkClipboard GtkClipboard; |
20 typedef struct _GtkSelectionData GtkSelectionData; | 22 typedef struct _GtkSelectionData GtkSelectionData; |
21 typedef struct _GtkIMContext GtkIMContext; | 23 typedef struct _GtkIMContext GtkIMContext; |
| 24 typedef struct _GtkSocket GtkSocket; |
22 | 25 |
23 // ----------------------------------------------------------------------------- | 26 // ----------------------------------------------------------------------------- |
24 // See comments in render_widget_host_view.h about this class and its members. | 27 // See comments in render_widget_host_view.h about this class and its members. |
25 // ----------------------------------------------------------------------------- | 28 // ----------------------------------------------------------------------------- |
26 class RenderWidgetHostViewGtk : public RenderWidgetHostView { | 29 class RenderWidgetHostViewGtk : public RenderWidgetHostView { |
27 public: | 30 public: |
28 RenderWidgetHostViewGtk(RenderWidgetHost* widget); | 31 RenderWidgetHostViewGtk(RenderWidgetHost* widget); |
29 ~RenderWidgetHostViewGtk(); | 32 ~RenderWidgetHostViewGtk(); |
30 | 33 |
31 // Initialize this object for use as a drawing area. | 34 // Initialize this object for use as a drawing area. |
(...skipping 20 matching lines...) Expand all Loading... |
52 virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect); | 55 virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect); |
53 virtual void DidPaintRect(const gfx::Rect& rect); | 56 virtual void DidPaintRect(const gfx::Rect& rect); |
54 virtual void DidScrollRect(const gfx::Rect& rect, int dx, int dy); | 57 virtual void DidScrollRect(const gfx::Rect& rect, int dx, int dy); |
55 virtual void RenderViewGone(); | 58 virtual void RenderViewGone(); |
56 virtual void Destroy(); | 59 virtual void Destroy(); |
57 virtual void SetTooltipText(const std::wstring& tooltip_text); | 60 virtual void SetTooltipText(const std::wstring& tooltip_text); |
58 virtual void SelectionChanged(const std::string& text); | 61 virtual void SelectionChanged(const std::string& text); |
59 virtual void PasteFromSelectionClipboard(); | 62 virtual void PasteFromSelectionClipboard(); |
60 virtual void ShowingContextMenu(bool showing); | 63 virtual void ShowingContextMenu(bool showing); |
61 virtual BackingStore* AllocBackingStore(const gfx::Size& size); | 64 virtual BackingStore* AllocBackingStore(const gfx::Size& size); |
| 65 virtual gfx::PluginWindowHandle CreatePluginContainer(); |
| 66 virtual void DestroyPluginContainer(gfx::PluginWindowHandle container); |
62 | 67 |
63 gfx::NativeView native_view() const { return view_.get(); } | 68 gfx::NativeView native_view() const { return view_.get(); } |
64 | 69 |
65 void Paint(const gfx::Rect&); | 70 void Paint(const gfx::Rect&); |
66 | 71 |
67 private: | 72 private: |
68 friend class RenderWidgetHostViewGtkWidget; | 73 friend class RenderWidgetHostViewGtkWidget; |
69 | 74 |
70 // Update the display cursor for the render view. | 75 // Update the display cursor for the render view. |
71 void ShowCurrentCursor(); | 76 void ShowCurrentCursor(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // a CJK text and a "preedit_end" signal after it finishes composing it. | 135 // 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 | 136 // 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 | 137 // composing Latin texts. So, we monitor the above signals to check whether |
133 // or not the GtkIMContext object is composing a CJK text. | 138 // or not the GtkIMContext object is composing a CJK text. |
134 bool im_is_composing_cjk_text_; | 139 bool im_is_composing_cjk_text_; |
135 | 140 |
136 // Represents the current modifier-key state. | 141 // Represents the current modifier-key state. |
137 // This state is used when GtkIMContext signal handlers create Char events | 142 // This state is used when GtkIMContext signal handlers create Char events |
138 // because they don't use the GdkEventKey objects and cannot get the state. | 143 // because they don't use the GdkEventKey objects and cannot get the state. |
139 int im_modifier_state_; | 144 int im_modifier_state_; |
| 145 |
| 146 // Helper class that lets us allocate plugin containers and move them. |
| 147 GtkPluginContainerHost plugin_container_host_; |
140 }; | 148 }; |
141 | 149 |
142 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ | 150 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ |
OLD | NEW |