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