[email protected] | 05d47875 | 2009-04-08 23:38:16 | [diff] [blame] | 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | 05d47875 | 2009-04-08 23:38:16 | [diff] [blame] | 5 | #ifndef CHROME_RENDERER_RENDER_WIDGET_H_ |
| 6 | #define CHROME_RENDERER_RENDER_WIDGET_H_ |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 7 | |
| 8 | #include <vector> |
[email protected] | 010ea08a | 2009-10-11 20:21:32 | [diff] [blame] | 9 | |
| 10 | #include "app/gfx/native_widget_types.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 11 | #include "base/basictypes.h" |
| 12 | #include "base/gfx/point.h" |
| 13 | #include "base/gfx/rect.h" |
| 14 | #include "base/gfx/size.h" |
| 15 | #include "base/ref_counted.h" |
[email protected] | 67474193 | 2009-02-04 23:44:46 | [diff] [blame] | 16 | #include "base/shared_memory.h" |
[email protected] | 246a7045 | 2010-03-05 21:53:50 | [diff] [blame] | 17 | #include "chrome/renderer/gpu_channel_host.h" |
[email protected] | 552e600 | 2009-11-19 05:24:57 | [diff] [blame] | 18 | #include "chrome/renderer/paint_aggregator.h" |
[email protected] | e68e62fa | 2009-02-20 02:00:04 | [diff] [blame] | 19 | #include "chrome/renderer/render_process.h" |
[email protected] | 946d1b2 | 2009-07-22 23:57:21 | [diff] [blame] | 20 | #include "ipc/ipc_channel.h" |
[email protected] | 246a7045 | 2010-03-05 21:53:50 | [diff] [blame] | 21 | #include "ipc/ipc_channel_handle.h" |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 22 | #include "skia/ext/platform_canvas.h" |
[email protected] | d5282e7 | 2009-05-13 13:16:52 | [diff] [blame] | 23 | #include "third_party/skia/include/core/SkBitmap.h" |
[email protected] | 418ed5ab | 2009-11-12 01:14:49 | [diff] [blame] | 24 | #include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h" |
| 25 | #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
| 26 | #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" |
| 27 | #include "third_party/WebKit/WebKit/chromium/public/WebWidgetClient.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 28 | #include "webkit/glue/webcursor.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 29 | |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 30 | class RenderThreadBase; |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 31 | struct ViewHostMsg_ShowPopup_Params; |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 32 | |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 33 | namespace WebKit { |
| 34 | struct WebPopupMenuInfo; |
| 35 | } |
| 36 | |
[email protected] | f103ab7 | 2009-09-02 17:10:59 | [diff] [blame] | 37 | namespace webkit_glue { |
| 38 | struct WebPluginGeometry; |
| 39 | } |
| 40 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 41 | // RenderWidget provides a communication bridge between a WebWidget and |
| 42 | // a RenderWidgetHost, the latter of which lives in a different process. |
| 43 | class RenderWidget : public IPC::Channel::Listener, |
| 44 | public IPC::Message::Sender, |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 45 | virtual public WebKit::WebWidgetClient, |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 46 | public base::RefCounted<RenderWidget> { |
| 47 | public: |
| 48 | // Creates a new RenderWidget. The opener_id is the routing ID of the |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 49 | // RenderView that this widget lives inside. The render_thread is any |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 50 | // RenderThreadBase implementation, mostly commonly RenderThread::current(). |
[email protected] | 0ebf387 | 2008-11-07 21:35:03 | [diff] [blame] | 51 | static RenderWidget* Create(int32 opener_id, |
| 52 | RenderThreadBase* render_thread, |
[email protected] | cfd727f | 2009-01-09 20:21:11 | [diff] [blame] | 53 | bool activatable); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 54 | |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 55 | // Called after Create to configure a RenderWidget to be rendered by the host |
| 56 | // as a popup menu with the given data. |
| 57 | void ConfigureAsExternalPopupMenu(const WebKit::WebPopupMenuInfo& info); |
| 58 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 59 | // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if |
| 60 | // not yet assigned a view ID, in which case, the process MUST NOT send |
| 61 | // messages with this ID to the parent. |
| 62 | int32 routing_id() const { |
| 63 | return routing_id_; |
| 64 | } |
| 65 | |
| 66 | // May return NULL when the window is closing. |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 67 | WebKit::WebWidget* webwidget() const { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 68 | return webwidget_; |
| 69 | } |
| 70 | |
[email protected] | c1f50aa | 2010-02-18 03:46:57 | [diff] [blame] | 71 | gfx::NativeViewId host_window() const { |
| 72 | return host_window_; |
| 73 | } |
| 74 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 75 | // IPC::Channel::Listener |
| 76 | virtual void OnMessageReceived(const IPC::Message& msg); |
| 77 | |
| 78 | // IPC::Message::Sender |
| 79 | virtual bool Send(IPC::Message* msg); |
| 80 | |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 81 | // WebKit::WebWidgetClient |
| 82 | virtual void didInvalidateRect(const WebKit::WebRect&); |
| 83 | virtual void didScrollRect(int dx, int dy, const WebKit::WebRect& clipRect); |
| 84 | virtual void didFocus(); |
| 85 | virtual void didBlur(); |
| 86 | virtual void didChangeCursor(const WebKit::WebCursorInfo&); |
| 87 | virtual void closeWidgetSoon(); |
| 88 | virtual void show(WebKit::WebNavigationPolicy); |
| 89 | virtual void runModal() {} |
| 90 | virtual WebKit::WebRect windowRect(); |
| 91 | virtual void setWindowRect(const WebKit::WebRect&); |
| 92 | virtual WebKit::WebRect windowResizerRect(); |
| 93 | virtual WebKit::WebRect rootWindowRect(); |
| 94 | virtual WebKit::WebScreenInfo screenInfo(); |
| 95 | |
| 96 | // Called when a plugin is moved. These events are queued up and sent with |
| 97 | // the next paint or scroll message to the host. |
[email protected] | f103ab7 | 2009-09-02 17:10:59 | [diff] [blame] | 98 | void SchedulePluginMove(const webkit_glue::WebPluginGeometry& move); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 99 | |
[email protected] | 26865477 | 2009-08-06 23:02:04 | [diff] [blame] | 100 | // Called when a plugin window has been destroyed, to make sure the currently |
| 101 | // pending moves don't try to reference it. |
| 102 | void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
| 103 | |
[email protected] | b4b967e | 2009-04-22 11:33:05 | [diff] [blame] | 104 | // Invalidates entire widget rect to generate a full repaint. |
| 105 | void GenerateFullRepaint(); |
| 106 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 107 | // Close the underlying WebWidget. |
[email protected] | 60c42a8c7 | 2009-10-09 04:08:59 | [diff] [blame] | 108 | virtual void Close(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 109 | |
[email protected] | 246a7045 | 2010-03-05 21:53:50 | [diff] [blame] | 110 | // Asynchronously establish a channel to the GPU plugin if not previously |
| 111 | // established or if it has been lost (for example if the GPU plugin crashed). |
| 112 | // Use GetGpuChannel() to determine when the channel is ready for use. |
| 113 | void EstablishGpuChannel(); |
| 114 | |
| 115 | // Get the GPU channel. Returns NULL if the channel is not established or |
| 116 | // has been lost. |
| 117 | GpuChannelHost* GetGpuChannel(); |
| 118 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 119 | protected: |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 120 | // Friend RefCounted so that the dtor can be non-public. Using this class |
| 121 | // without ref-counting is an error. |
| 122 | friend class base::RefCounted<RenderWidget>; |
| 123 | |
[email protected] | cfd727f | 2009-01-09 20:21:11 | [diff] [blame] | 124 | RenderWidget(RenderThreadBase* render_thread, bool activatable); |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 125 | virtual ~RenderWidget(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 126 | |
| 127 | // Initializes this view with the given opener. CompleteInit must be called |
| 128 | // later. |
| 129 | void Init(int32 opener_id); |
| 130 | |
| 131 | // Finishes creation of a pending view started with Init. |
[email protected] | 18bcc3c | 2009-01-27 21:39:15 | [diff] [blame] | 132 | void CompleteInit(gfx::NativeViewId parent); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 133 | |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 134 | // Paints the given rectangular region of the WebWidget into canvas (a |
| 135 | // shared memory segment returned by AllocPaintBuf on Windows). The caller |
| 136 | // must ensure that the given rect fits within the bounds of the WebWidget. |
[email protected] | 4fb6684 | 2009-12-04 21:41:00 | [diff] [blame] | 137 | void PaintRect(const gfx::Rect& rect, const gfx::Point& canvas_origin, |
| 138 | skia::PlatformCanvas* canvas); |
| 139 | |
| 140 | // Paints a border at the given rect for debugging purposes. |
| 141 | void PaintDebugBorder(const gfx::Rect& rect, skia::PlatformCanvas* canvas); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 142 | |
[email protected] | 552e600 | 2009-11-19 05:24:57 | [diff] [blame] | 143 | void CallDoDeferredUpdate(); |
| 144 | void DoDeferredUpdate(); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 145 | void DoDeferredClose(); |
| 146 | void DoDeferredSetWindowRect(const WebKit::WebRect& pos); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 147 | |
[email protected] | 699ab0d | 2009-04-23 23:19:14 | [diff] [blame] | 148 | // Set the background of the render widget to a bitmap. The bitmap will be |
| 149 | // tiled in both directions if it isn't big enough to fill the area. This is |
| 150 | // mainly intended to be used in conjuction with WebView::SetIsTransparent(). |
| 151 | virtual void SetBackground(const SkBitmap& bitmap); |
| 152 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 153 | // RenderWidget IPC message handlers |
| 154 | void OnClose(); |
[email protected] | 18bcc3c | 2009-01-27 21:39:15 | [diff] [blame] | 155 | void OnCreatingNewAck(gfx::NativeViewId parent); |
[email protected] | 30f75e6 | 2009-02-25 22:01:00 | [diff] [blame] | 156 | virtual void OnResize(const gfx::Size& new_size, |
| 157 | const gfx::Rect& resizer_rect); |
[email protected] | 941e455 | 2010-02-01 21:23:43 | [diff] [blame] | 158 | virtual void OnWasHidden(); |
| 159 | virtual void OnWasRestored(bool needs_repainting); |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 160 | void OnUpdateRectAck(); |
[email protected] | 8400e03 | 2010-02-26 18:50:11 | [diff] [blame] | 161 | void OnCreateVideoAck(int32 video_id); |
| 162 | void OnUpdateVideoAck(int32 video_id); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 163 | void OnRequestMoveAck(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 164 | void OnHandleInputEvent(const IPC::Message& message); |
| 165 | void OnMouseCaptureLost(); |
[email protected] | 1e6e3c99 | 2010-02-08 15:52:13 | [diff] [blame] | 166 | virtual void OnSetFocus(bool enable); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 167 | void OnImeSetInputMode(bool is_active); |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 168 | void OnImeSetComposition(WebKit::WebCompositionCommand command, |
| 169 | int cursor_position, |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 170 | int target_start, int target_end, |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 171 | const string16& ime_string); |
[email protected] | ec7dc11 | 2008-08-06 05:30:12 | [diff] [blame] | 172 | void OnMsgRepaint(const gfx::Size& size_to_paint); |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 173 | void OnSetTextDirection(WebKit::WebTextDirection direction); |
[email protected] | 246a7045 | 2010-03-05 21:53:50 | [diff] [blame] | 174 | void OnGpuChannelEstablished(const IPC::ChannelHandle& channel_handle); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 175 | |
[email protected] | 00c3961 | 2010-03-06 02:53:28 | [diff] [blame^] | 176 | // Override point to notify derived classes that a paint has happened. |
| 177 | // DidInitiatePaint happens when we've generated a new bitmap and sent it to |
| 178 | // the browser. DidFlushPaint happens once we've received the ACK that the |
| 179 | // screen has actually been updated. |
| 180 | virtual void DidInitiatePaint() {} |
| 181 | virtual void DidFlushPaint() {} |
[email protected] | a2f6bc11 | 2009-06-27 16:27:25 | [diff] [blame] | 182 | |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 183 | // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
| 184 | // use this method so that we can properly inform the RenderThread of our |
| 185 | // state. |
| 186 | void SetHidden(bool hidden); |
| 187 | |
[email protected] | 882daa9 | 2009-11-05 16:31:31 | [diff] [blame] | 188 | bool is_hidden() const { return is_hidden_; } |
| 189 | |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 190 | // True if an UpdateRect_ACK message is pending. |
| 191 | bool update_reply_pending() const { |
| 192 | return update_reply_pending_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 193 | } |
| 194 | |
[email protected] | 67474193 | 2009-02-04 23:44:46 | [diff] [blame] | 195 | bool next_paint_is_resize_ack() const; |
| 196 | bool next_paint_is_restore_ack() const; |
| 197 | void set_next_paint_is_resize_ack(); |
| 198 | void set_next_paint_is_restore_ack(); |
| 199 | void set_next_paint_is_repaint_ack(); |
[email protected] | ec7dc11 | 2008-08-06 05:30:12 | [diff] [blame] | 200 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 201 | // Called when a renderer process moves an input focus or updates the |
| 202 | // position of its caret. |
| 203 | // This function compares them with the previous values, and send them to |
| 204 | // the browser process only if they are updated. |
| 205 | // The browser process moves IME windows and context. |
| 206 | void UpdateIME(); |
| 207 | |
| 208 | // Tells the renderer it does not have focus. Used to prevent us from getting |
| 209 | // the focus on our own when the browser did not focus us. |
| 210 | void ClearFocus(); |
| 211 | |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 212 | // Set the pending window rect. |
| 213 | // Because the real render_widget is hosted in another process, there is |
| 214 | // a time period where we may have set a new window rect which has not yet |
| 215 | // been processed by the browser. So we maintain a pending window rect |
| 216 | // size. If JS code sets the WindowRect, and then immediately calls |
| 217 | // GetWindowRect() we'll use this pending window rect as the size. |
| 218 | void SetPendingWindowRect(const WebKit::WebRect& r); |
| 219 | |
[email protected] | 44670587 | 2009-09-10 07:22:48 | [diff] [blame] | 220 | // Called by OnHandleInputEvent() to notify subclasses that a key event was |
| 221 | // just handled. |
| 222 | virtual void DidHandleKeyEvent() {} |
| 223 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 224 | // Routing ID that allows us to communicate to the parent browser process |
| 225 | // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
| 226 | int32 routing_id_; |
| 227 | |
[email protected] | c5b3b5e | 2009-02-13 06:41:11 | [diff] [blame] | 228 | // We are responsible for destroying this object via its Close method. |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 229 | WebKit::WebWidget* webwidget_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 230 | |
| 231 | // Set to the ID of the view that initiated creating this view, if any. When |
| 232 | // the view was initiated by the browser (the common case), this will be |
| 233 | // MSG_ROUTING_NONE. This is used in determining ownership when opening |
| 234 | // child tabs. See RenderWidget::createWebViewWithRequest. |
| 235 | // |
| 236 | // This ID may refer to an invalid view if that view is closed before this |
| 237 | // view is. |
| 238 | int32 opener_id_; |
| 239 | |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 240 | // The thread that does our IPC. |
| 241 | RenderThreadBase* render_thread_; |
| 242 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 243 | // The position where this view should be initially shown. |
| 244 | gfx::Rect initial_pos_; |
| 245 | |
| 246 | // The window we are embedded within. TODO(darin): kill this. |
[email protected] | 18bcc3c | 2009-01-27 21:39:15 | [diff] [blame] | 247 | gfx::NativeViewId host_window_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 248 | |
| 249 | // We store the current cursor object so we can avoid spamming SetCursor |
| 250 | // messages. |
| 251 | WebCursor current_cursor_; |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 252 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 253 | // The size of the RenderWidget. |
| 254 | gfx::Size size_; |
| 255 | |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 256 | // The TransportDIB that is being used to transfer an image to the browser. |
[email protected] | e68e62fa | 2009-02-20 02:00:04 | [diff] [blame] | 257 | TransportDIB* current_paint_buf_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 258 | |
[email protected] | 552e600 | 2009-11-19 05:24:57 | [diff] [blame] | 259 | PaintAggregator paint_aggregator_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 260 | |
[email protected] | f21c613a | 2009-02-12 14:46:17 | [diff] [blame] | 261 | // The area that must be reserved for drawing the resize corner. |
| 262 | gfx::Rect resizer_rect_; |
| 263 | |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 264 | // Flags for the next ViewHostMsg_UpdateRect message. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 265 | int next_paint_flags_; |
| 266 | |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 267 | // True if we are expecting an UpdateRect_ACK message (i.e., that a |
| 268 | // UpdateRect message has been sent). |
| 269 | bool update_reply_pending_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 270 | |
| 271 | // Set to true if we should ignore RenderWidget::Show calls. |
| 272 | bool did_show_; |
| 273 | |
| 274 | // Indicates that we shouldn't bother generated paint events. |
| 275 | bool is_hidden_; |
| 276 | |
| 277 | // Indicates that we should be repainted when restored. This flag is set to |
| 278 | // true if we receive an invalidation / scroll event from webkit while our |
| 279 | // is_hidden_ flag is set to true. This is used to force a repaint once we |
| 280 | // restore to account for the fact that our host would not know about the |
| 281 | // invalidation / scroll event(s) from webkit while we are hidden. |
| 282 | bool needs_repainting_on_restore_; |
| 283 | |
| 284 | // Indicates whether we have been focused/unfocused by the browser. |
| 285 | bool has_focus_; |
| 286 | |
[email protected] | 5dd76821 | 2009-08-13 23:34:49 | [diff] [blame] | 287 | // Are we currently handling an input event? |
| 288 | bool handling_input_event_; |
| 289 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 290 | // True if we have requested this widget be closed. No more messages will |
| 291 | // be sent, except for a Close. |
| 292 | bool closing_; |
| 293 | |
| 294 | // Represents whether or not the IME of a browser process is active. |
| 295 | bool ime_is_active_; |
| 296 | |
| 297 | // Represents the status of the selected edit control sent to a browser |
| 298 | // process last time. |
| 299 | // When a renderer process finishes rendering a region, it retrieves: |
| 300 | // * The identifier of the selected edit control; |
| 301 | // * Whether or not the selected edit control requires IME, and; |
| 302 | // * The position of the caret (or cursor). |
| 303 | // If the above values is updated, a renderer process sends an IPC message |
| 304 | // to a browser process. A browser process uses these values to |
| 305 | // activate/deactivate IME and set the position of IME windows. |
| 306 | bool ime_control_enable_ime_; |
| 307 | int ime_control_x_; |
| 308 | int ime_control_y_; |
| 309 | bool ime_control_new_state_; |
| 310 | bool ime_control_updated_; |
[email protected] | 9f23f59 | 2008-11-17 08:36:34 | [diff] [blame] | 311 | bool ime_control_busy_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 312 | |
[email protected] | cfd727f | 2009-01-09 20:21:11 | [diff] [blame] | 313 | // Whether the window for this RenderWidget can be activated. |
| 314 | bool activatable_; |
[email protected] | 0ebf387 | 2008-11-07 21:35:03 | [diff] [blame] | 315 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 316 | // Holds all the needed plugin window moves for a scroll. |
[email protected] | f103ab7 | 2009-09-02 17:10:59 | [diff] [blame] | 317 | typedef std::vector<webkit_glue::WebPluginGeometry> WebPluginGeometryVector; |
[email protected] | 26865477 | 2009-08-06 23:02:04 | [diff] [blame] | 318 | WebPluginGeometryVector plugin_window_moves_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 319 | |
[email protected] | 699ab0d | 2009-04-23 23:19:14 | [diff] [blame] | 320 | // A custom background for the widget. |
| 321 | SkBitmap background_; |
| 322 | |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 323 | // While we are waiting for the browser to update window sizes, |
| 324 | // we track the pending size temporarily. |
| 325 | int pending_window_rect_count_; |
| 326 | WebKit::WebRect pending_window_rect_; |
| 327 | |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 328 | scoped_ptr<ViewHostMsg_ShowPopup_Params> popup_params_; |
| 329 | |
[email protected] | 12fbad81 | 2009-09-01 18:21:24 | [diff] [blame] | 330 | scoped_ptr<IPC::Message> pending_input_event_ack_; |
| 331 | |
[email protected] | 867125a0 | 2009-12-10 06:01:48 | [diff] [blame] | 332 | // Indicates if the next sequence of Char events should be suppressed or not. |
| 333 | bool suppress_next_char_events_; |
| 334 | |
[email protected] | 246a7045 | 2010-03-05 21:53:50 | [diff] [blame] | 335 | // The channel from the renderer process to the GPU process. |
| 336 | scoped_refptr<GpuChannelHost> gpu_channel_; |
| 337 | |
[email protected] | 05d47875 | 2009-04-08 23:38:16 | [diff] [blame] | 338 | DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 339 | }; |
| 340 | |
[email protected] | 05d47875 | 2009-04-08 23:38:16 | [diff] [blame] | 341 | #endif // CHROME_RENDERER_RENDER_WIDGET_H_ |