blob: 05a7d5fcebaab2579ba321ed517f72de000ffac6 [file] [log] [blame]
[email protected]b9b751f22011-03-25 14:04:121// Copyright (c) 2011 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
[email protected]2cff0052011-03-18 16:51:445#ifndef CONTENT_RENDERER_RENDER_WIDGET_H_
6#define CONTENT_RENDERER_RENDER_WIDGET_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
initial.commit09911bf2008-07-26 23:55:298
9#include <vector>
[email protected]010ea08a2009-10-11 20:21:3210
initial.commit09911bf2008-07-26 23:55:2911#include "base/basictypes.h"
[email protected]3b63f8f42011-03-28 01:54:1512#include "base/memory/ref_counted.h"
[email protected]8704f89b2011-04-15 00:30:0513#include "base/memory/scoped_ptr.h"
14#include "base/time.h"
[email protected]921f1592011-03-18 00:41:0215#include "content/renderer/paint_aggregator.h"
[email protected]946d1b22009-07-22 23:57:2116#include "ipc/ipc_channel.h"
[email protected]8bd0fe62011-01-17 06:44:3717#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
18#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h"
19#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
20#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
[email protected]8bd0fe62011-01-17 06:44:3721#include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h"
[email protected]d65adb12010-04-28 17:26:4922#include "third_party/skia/include/core/SkBitmap.h"
[email protected]ad26ef42011-06-17 07:59:4523#include "ui/base/ime/text_input_type.h"
[email protected]08397d52011-02-05 01:53:3824#include "ui/gfx/native_widget_types.h"
25#include "ui/gfx/rect.h"
26#include "ui/gfx/size.h"
[email protected]b9b751f22011-03-25 14:04:1227#include "ui/gfx/surface/transport_dib.h"
initial.commit09911bf2008-07-26 23:55:2928#include "webkit/glue/webcursor.h"
initial.commit09911bf2008-07-26 23:55:2929
[email protected]8085dbc82008-09-26 22:53:4430class RenderThreadBase;
31
[email protected]46f36a492010-07-28 19:36:4132namespace gfx {
33class Point;
34}
35
[email protected]484955942010-08-19 16:13:1836namespace IPC {
37class SyncMessage;
38}
39
[email protected]46f36a492010-07-28 19:36:4140namespace skia {
41class PlatformCanvas;
42}
43
[email protected]88efb7ec2009-07-14 16:32:5944namespace WebKit {
[email protected]6a8ddba52010-09-05 04:38:0645class WebMouseEvent;
[email protected]484955942010-08-19 16:13:1846class WebWidget;
[email protected]88efb7ec2009-07-14 16:32:5947struct WebPopupMenuInfo;
48}
49
[email protected]191eb3f72010-12-21 06:27:5050namespace webkit {
51namespace npapi {
[email protected]f103ab72009-09-02 17:10:5952struct WebPluginGeometry;
[email protected]719b36f2010-12-22 20:36:4653} // namespace npapi
54
55namespace ppapi {
56class PluginInstance;
57} // namespace ppapi
58} // namespace webkit
[email protected]f103ab72009-09-02 17:10:5959
initial.commit09911bf2008-07-26 23:55:2960// RenderWidget provides a communication bridge between a WebWidget and
61// a RenderWidgetHost, the latter of which lives in a different process.
62class RenderWidget : public IPC::Channel::Listener,
63 public IPC::Message::Sender,
[email protected]4873c7d2009-07-16 06:36:2864 virtual public WebKit::WebWidgetClient,
initial.commit09911bf2008-07-26 23:55:2965 public base::RefCounted<RenderWidget> {
66 public:
67 // Creates a new RenderWidget. The opener_id is the routing ID of the
[email protected]8085dbc82008-09-26 22:53:4468 // RenderView that this widget lives inside. The render_thread is any
[email protected]8930d472009-02-21 08:05:2869 // RenderThreadBase implementation, mostly commonly RenderThread::current().
[email protected]0ebf3872008-11-07 21:35:0370 static RenderWidget* Create(int32 opener_id,
71 RenderThreadBase* render_thread,
[email protected]3e2b375b2010-04-07 17:03:1272 WebKit::WebPopupType popup_type);
initial.commit09911bf2008-07-26 23:55:2973
[email protected]484955942010-08-19 16:13:1874 // Creates a WebWidget based on the popup type.
75 static WebKit::WebWidget* CreateWebWidget(RenderWidget* render_widget);
76
[email protected]c03a6e72011-04-19 21:42:0677 // The compositing surface assigned by the RenderWidgetHost
78 // (or RenderViewHost). Will be gfx::kNullPluginWindow if not assigned yet,
79 // in which case we should not create any GPU command buffers with it.
initial.commit09911bf2008-07-26 23:55:2980 // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if
81 // not yet assigned a view ID, in which case, the process MUST NOT send
82 // messages with this ID to the parent.
83 int32 routing_id() const {
84 return routing_id_;
85 }
86
87 // May return NULL when the window is closing.
[email protected]93b9d692011-04-13 00:44:3188 WebKit::WebWidget* webwidget() const { return webwidget_; }
89 gfx::NativeViewId host_window() const { return host_window_; }
90 gfx::Size size() const { return size_; }
[email protected]589621b2010-09-23 22:01:0791 bool has_focus() const { return has_focus_; }
92
initial.commit09911bf2008-07-26 23:55:2993 // IPC::Channel::Listener
[email protected]a95986a82010-12-24 06:19:2894 virtual bool OnMessageReceived(const IPC::Message& msg);
initial.commit09911bf2008-07-26 23:55:2995
96 // IPC::Message::Sender
97 virtual bool Send(IPC::Message* msg);
98
[email protected]4873c7d2009-07-16 06:36:2899 // WebKit::WebWidgetClient
100 virtual void didInvalidateRect(const WebKit::WebRect&);
101 virtual void didScrollRect(int dx, int dy, const WebKit::WebRect& clipRect);
[email protected]a79d8a632010-11-18 22:35:56102 virtual void didActivateAcceleratedCompositing(bool active);
[email protected]f98d7e3c2010-09-13 22:30:46103 virtual void scheduleComposite();
[email protected]5f8b1022011-01-21 23:34:50104 virtual void scheduleAnimation();
[email protected]4873c7d2009-07-16 06:36:28105 virtual void didFocus();
106 virtual void didBlur();
107 virtual void didChangeCursor(const WebKit::WebCursorInfo&);
108 virtual void closeWidgetSoon();
109 virtual void show(WebKit::WebNavigationPolicy);
110 virtual void runModal() {}
111 virtual WebKit::WebRect windowRect();
[email protected]8a9d6ca32011-06-06 20:11:30112 virtual void setToolTipText(const WebKit::WebString& text,
113 WebKit::WebTextDirection hint);
[email protected]4873c7d2009-07-16 06:36:28114 virtual void setWindowRect(const WebKit::WebRect&);
115 virtual WebKit::WebRect windowResizerRect();
116 virtual WebKit::WebRect rootWindowRect();
117 virtual WebKit::WebScreenInfo screenInfo();
[email protected]fa7b1dc2010-06-23 17:53:04118 virtual void resetInputMethod();
[email protected]4873c7d2009-07-16 06:36:28119
120 // Called when a plugin is moved. These events are queued up and sent with
121 // the next paint or scroll message to the host.
[email protected]191eb3f72010-12-21 06:27:50122 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move);
initial.commit09911bf2008-07-26 23:55:29123
[email protected]268654772009-08-06 23:02:04124 // Called when a plugin window has been destroyed, to make sure the currently
125 // pending moves don't try to reference it.
126 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window);
127
initial.commit09911bf2008-07-26 23:55:29128 // Close the underlying WebWidget.
[email protected]60c42a8c72009-10-09 04:08:59129 virtual void Close();
initial.commit09911bf2008-07-26 23:55:29130
[email protected]a1127f82011-09-08 17:27:01131 float filtered_time_per_frame() const {
132 return filtered_time_per_frame_;
133 }
134
initial.commit09911bf2008-07-26 23:55:29135 protected:
[email protected]8085dbc82008-09-26 22:53:44136 // Friend RefCounted so that the dtor can be non-public. Using this class
137 // without ref-counting is an error.
138 friend class base::RefCounted<RenderWidget>;
[email protected]7339cd22010-10-27 00:11:20139 // For unit tests.
140 friend class RenderWidgetTest;
[email protected]8085dbc82008-09-26 22:53:44141
[email protected]3e2b375b2010-04-07 17:03:12142 RenderWidget(RenderThreadBase* render_thread,
143 WebKit::WebPopupType popup_type);
[email protected]8085dbc82008-09-26 22:53:44144 virtual ~RenderWidget();
initial.commit09911bf2008-07-26 23:55:29145
146 // Initializes this view with the given opener. CompleteInit must be called
147 // later.
148 void Init(int32 opener_id);
149
[email protected]484955942010-08-19 16:13:18150 // Called by Init and subclasses to perform initialization.
151 void DoInit(int32 opener_id,
152 WebKit::WebWidget* web_widget,
153 IPC::SyncMessage* create_widget_message);
154
initial.commit09911bf2008-07-26 23:55:29155 // Finishes creation of a pending view started with Init.
[email protected]2d7c8552011-06-27 19:21:55156 void CompleteInit(gfx::NativeViewId parent);
initial.commit09911bf2008-07-26 23:55:29157
[email protected]992db4c2011-05-12 15:37:15158 // Sets whether this RenderWidget has been swapped out to be displayed by
159 // a RenderWidget in a different process. If so, no new IPC messages will be
160 // sent (only ACKs) and the process is free to exit when there are no other
161 // active RenderWidgets.
162 void SetSwappedOut(bool is_swapped_out);
163
[email protected]661eb9d2009-02-03 02:11:48164 // Paints the given rectangular region of the WebWidget into canvas (a
165 // shared memory segment returned by AllocPaintBuf on Windows). The caller
166 // must ensure that the given rect fits within the bounds of the WebWidget.
[email protected]4fb66842009-12-04 21:41:00167 void PaintRect(const gfx::Rect& rect, const gfx::Point& canvas_origin,
168 skia::PlatformCanvas* canvas);
169
170 // Paints a border at the given rect for debugging purposes.
171 void PaintDebugBorder(const gfx::Rect& rect, skia::PlatformCanvas* canvas);
initial.commit09911bf2008-07-26 23:55:29172
[email protected]bd37ae252011-06-03 01:28:18173 bool IsRenderingVSynced();
[email protected]52ccd0ea2011-02-16 01:09:05174 void AnimationCallback();
175 void AnimateIfNeeded();
[email protected]65225772011-05-12 21:10:24176 void InvalidationCallback();
177 void DoDeferredUpdateAndSendInputAck();
[email protected]552e6002009-11-19 05:24:57178 void DoDeferredUpdate();
[email protected]2533ce12009-05-09 00:02:24179 void DoDeferredClose();
180 void DoDeferredSetWindowRect(const WebKit::WebRect& pos);
initial.commit09911bf2008-07-26 23:55:29181
[email protected]699ab0d2009-04-23 23:19:14182 // Set the background of the render widget to a bitmap. The bitmap will be
183 // tiled in both directions if it isn't big enough to fill the area. This is
184 // mainly intended to be used in conjuction with WebView::SetIsTransparent().
185 virtual void SetBackground(const SkBitmap& bitmap);
186
initial.commit09911bf2008-07-26 23:55:29187 // RenderWidget IPC message handlers
188 void OnClose();
[email protected]2d7c8552011-06-27 19:21:55189 void OnCreatingNewAck(gfx::NativeViewId parent);
[email protected]30f75e62009-02-25 22:01:00190 virtual void OnResize(const gfx::Size& new_size,
191 const gfx::Rect& resizer_rect);
[email protected]941e4552010-02-01 21:23:43192 virtual void OnWasHidden();
193 virtual void OnWasRestored(bool needs_repainting);
[email protected]992db4c2011-05-12 15:37:15194 virtual void OnWasSwappedOut();
[email protected]53d3f302009-12-21 04:42:05195 void OnUpdateRectAck();
[email protected]8400e032010-02-26 18:50:11196 void OnCreateVideoAck(int32 video_id);
197 void OnUpdateVideoAck(int32 video_id);
[email protected]2533ce12009-05-09 00:02:24198 void OnRequestMoveAck();
initial.commit09911bf2008-07-26 23:55:29199 void OnHandleInputEvent(const IPC::Message& message);
200 void OnMouseCaptureLost();
[email protected]1e6e3c992010-02-08 15:52:13201 virtual void OnSetFocus(bool enable);
[email protected]fa7b1dc2010-06-23 17:53:04202 void OnSetInputMethodActive(bool is_active);
[email protected]56ea1a62011-05-30 07:05:57203 virtual void OnImeSetComposition(
[email protected]fa7b1dc2010-06-23 17:53:04204 const string16& text,
205 const std::vector<WebKit::WebCompositionUnderline>& underlines,
206 int selection_start,
207 int selection_end);
[email protected]56ea1a62011-05-30 07:05:57208 virtual void OnImeConfirmComposition(const string16& text);
[email protected]d65adb12010-04-28 17:26:49209 void OnMsgPaintAtSize(const TransportDIB::Handle& dib_id,
[email protected]c88c9442010-07-19 18:55:09210 int tag,
[email protected]948f7ab72010-05-28 23:48:08211 const gfx::Size& page_size,
[email protected]d65adb12010-04-28 17:26:49212 const gfx::Size& desired_size);
[email protected]ec7dc112008-08-06 05:30:12213 void OnMsgRepaint(const gfx::Size& size_to_paint);
[email protected]4873c7d2009-07-16 06:36:28214 void OnSetTextDirection(WebKit::WebTextDirection direction);
[email protected]872ae5b2011-05-26 20:20:50215 void OnGetFPS();
initial.commit09911bf2008-07-26 23:55:29216
[email protected]00c39612010-03-06 02:53:28217 // Override point to notify derived classes that a paint has happened.
218 // DidInitiatePaint happens when we've generated a new bitmap and sent it to
219 // the browser. DidFlushPaint happens once we've received the ACK that the
220 // screen has actually been updated.
221 virtual void DidInitiatePaint() {}
222 virtual void DidFlushPaint() {}
[email protected]a2f6bc112009-06-27 16:27:25223
[email protected]65225772011-05-12 21:10:24224 // Override and return true when the widget is rendered with a graphics
[email protected]37a6f302011-07-11 23:43:08225 // context that supports asynchronous swapbuffers. When returning true, the
226 // subclass must call OnSwapBuffersPosted() when swap is posted,
227 // OnSwapBuffersComplete() when swaps complete, and OnSwapBuffersAborted if
228 // the context is lost.
[email protected]65225772011-05-12 21:10:24229 virtual bool SupportsAsynchronousSwapBuffers();
230
231 // Notifies scheduler that the RenderWidget's subclass has finished or aborted
232 // a swap buffers.
[email protected]37a6f302011-07-11 23:43:08233 void OnSwapBuffersPosted();
[email protected]65225772011-05-12 21:10:24234 void OnSwapBuffersComplete();
[email protected]37a6f302011-07-11 23:43:08235 void OnSwapBuffersAborted();
[email protected]65225772011-05-12 21:10:24236
[email protected]ca4847f2010-09-24 05:39:15237 // Detects if a suitable opaque plugin covers the given paint bounds with no
238 // compositing necessary.
239 //
[email protected]719b36f2010-12-22 20:36:46240 // Returns the plugin instance that's the source of the paint if the paint
241 // can be handled by just blitting the plugin bitmap. In this case, the
242 // location, clipping, and ID of the backing store will be filled into the
243 // given output parameters.
[email protected]ca4847f2010-09-24 05:39:15244 //
[email protected]719b36f2010-12-22 20:36:46245 // A return value of null means optimized painting can not be used and we
[email protected]ca4847f2010-09-24 05:39:15246 // should continue with the normal painting code path.
[email protected]719b36f2010-12-22 20:36:46247 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint(
[email protected]ca4847f2010-09-24 05:39:15248 const gfx::Rect& paint_bounds,
249 TransportDIB** dib,
250 gfx::Rect* location,
251 gfx::Rect* clip);
252
[email protected]d54169e92011-01-21 09:19:52253 // Gets the scroll offset of this widget, if this widget has a notion of
254 // scroll offset.
[email protected]bcaf2272011-02-15 15:29:43255 virtual gfx::Point GetScrollOffset();
[email protected]d54169e92011-01-21 09:19:52256
[email protected]bee16aab2009-08-26 15:55:03257 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
258 // use this method so that we can properly inform the RenderThread of our
259 // state.
260 void SetHidden(bool hidden);
261
[email protected]882daa92009-11-05 16:31:31262 bool is_hidden() const { return is_hidden_; }
263
[email protected]53d3f302009-12-21 04:42:05264 // True if an UpdateRect_ACK message is pending.
265 bool update_reply_pending() const {
266 return update_reply_pending_;
initial.commit09911bf2008-07-26 23:55:29267 }
268
[email protected]674741932009-02-04 23:44:46269 bool next_paint_is_resize_ack() const;
270 bool next_paint_is_restore_ack() const;
271 void set_next_paint_is_resize_ack();
272 void set_next_paint_is_restore_ack();
273 void set_next_paint_is_repaint_ack();
[email protected]ec7dc112008-08-06 05:30:12274
[email protected]fa7b1dc2010-06-23 17:53:04275 // Checks if the input method state and caret position have been changed.
276 // If they are changed, the new value will be sent to the browser process.
277 void UpdateInputMethod();
initial.commit09911bf2008-07-26 23:55:29278
[email protected]56ea1a62011-05-30 07:05:57279 // Override point to obtain that the current input method state and caret
280 // position.
[email protected]ad26ef42011-06-17 07:59:45281 virtual ui::TextInputType GetTextInputType();
282
283 // Override point to obtain that the current input method state about
284 // composition text.
285 virtual bool CanComposeInline();
[email protected]56ea1a62011-05-30 07:05:57286
initial.commit09911bf2008-07-26 23:55:29287 // Tells the renderer it does not have focus. Used to prevent us from getting
288 // the focus on our own when the browser did not focus us.
289 void ClearFocus();
290
[email protected]2533ce12009-05-09 00:02:24291 // Set the pending window rect.
292 // Because the real render_widget is hosted in another process, there is
293 // a time period where we may have set a new window rect which has not yet
294 // been processed by the browser. So we maintain a pending window rect
295 // size. If JS code sets the WindowRect, and then immediately calls
296 // GetWindowRect() we'll use this pending window rect as the size.
297 void SetPendingWindowRect(const WebKit::WebRect& r);
298
[email protected]446705872009-09-10 07:22:48299 // Called by OnHandleInputEvent() to notify subclasses that a key event was
300 // just handled.
301 virtual void DidHandleKeyEvent() {}
302
[email protected]6a8ddba52010-09-05 04:38:06303 // Called by OnHandleInputEvent() to notify subclasses that a mouse event was
304 // just handled.
305 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {}
306
initial.commit09911bf2008-07-26 23:55:29307 // Routing ID that allows us to communicate to the parent browser process
308 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
309 int32 routing_id_;
310
[email protected]c5b3b5e2009-02-13 06:41:11311 // We are responsible for destroying this object via its Close method.
[email protected]4873c7d2009-07-16 06:36:28312 WebKit::WebWidget* webwidget_;
initial.commit09911bf2008-07-26 23:55:29313
314 // Set to the ID of the view that initiated creating this view, if any. When
315 // the view was initiated by the browser (the common case), this will be
316 // MSG_ROUTING_NONE. This is used in determining ownership when opening
317 // child tabs. See RenderWidget::createWebViewWithRequest.
318 //
319 // This ID may refer to an invalid view if that view is closed before this
320 // view is.
321 int32 opener_id_;
322
[email protected]8085dbc82008-09-26 22:53:44323 // The thread that does our IPC.
324 RenderThreadBase* render_thread_;
325
initial.commit09911bf2008-07-26 23:55:29326 // The position where this view should be initially shown.
327 gfx::Rect initial_pos_;
328
329 // The window we are embedded within. TODO(darin): kill this.
[email protected]18bcc3c2009-01-27 21:39:15330 gfx::NativeViewId host_window_;
initial.commit09911bf2008-07-26 23:55:29331
332 // We store the current cursor object so we can avoid spamming SetCursor
333 // messages.
334 WebCursor current_cursor_;
[email protected]88efb7ec2009-07-14 16:32:59335
initial.commit09911bf2008-07-26 23:55:29336 // The size of the RenderWidget.
337 gfx::Size size_;
338
[email protected]b4d08452010-10-05 17:34:35339 // The TransportDIB that is being used to transfer an image to the browser.
340 TransportDIB* current_paint_buf_;
initial.commit09911bf2008-07-26 23:55:29341
[email protected]552e6002009-11-19 05:24:57342 PaintAggregator paint_aggregator_;
initial.commit09911bf2008-07-26 23:55:29343
[email protected]f21c613a2009-02-12 14:46:17344 // The area that must be reserved for drawing the resize corner.
345 gfx::Rect resizer_rect_;
346
[email protected]53d3f302009-12-21 04:42:05347 // Flags for the next ViewHostMsg_UpdateRect message.
initial.commit09911bf2008-07-26 23:55:29348 int next_paint_flags_;
349
[email protected]872ae5b2011-05-26 20:20:50350 // Filtered time per frame based on UpdateRect messages.
351 float filtered_time_per_frame_;
352
[email protected]53d3f302009-12-21 04:42:05353 // True if we are expecting an UpdateRect_ACK message (i.e., that a
354 // UpdateRect message has been sent).
355 bool update_reply_pending_;
initial.commit09911bf2008-07-26 23:55:29356
[email protected]65225772011-05-12 21:10:24357 // True if the underlying graphics context supports asynchronous swap.
358 // Cached on the RenderWidget because determining support is costly.
359 bool using_asynchronous_swapbuffers_;
360
361 // Number of OnSwapBuffersComplete we are expecting. Incremented each time
362 // WebWidget::composite has been been performed when the RenderWidget subclass
363 // SupportsAsynchronousSwapBuffers. Decremented in OnSwapBuffers. Will block
364 // rendering.
365 int num_swapbuffers_complete_pending_;
366
367 // When accelerated rendering is on, is the maximum number of swapbuffers that
368 // can be outstanding before we start throttling based on
369 // OnSwapBuffersComplete callback.
[email protected]82ca9b92011-09-12 23:33:07370 static const int kMaxSwapBuffersPending = 2;
[email protected]65225772011-05-12 21:10:24371
initial.commit09911bf2008-07-26 23:55:29372 // Set to true if we should ignore RenderWidget::Show calls.
373 bool did_show_;
374
375 // Indicates that we shouldn't bother generated paint events.
376 bool is_hidden_;
377
378 // Indicates that we should be repainted when restored. This flag is set to
379 // true if we receive an invalidation / scroll event from webkit while our
380 // is_hidden_ flag is set to true. This is used to force a repaint once we
381 // restore to account for the fact that our host would not know about the
382 // invalidation / scroll event(s) from webkit while we are hidden.
383 bool needs_repainting_on_restore_;
384
385 // Indicates whether we have been focused/unfocused by the browser.
386 bool has_focus_;
387
[email protected]5dd768212009-08-13 23:34:49388 // Are we currently handling an input event?
389 bool handling_input_event_;
390
initial.commit09911bf2008-07-26 23:55:29391 // True if we have requested this widget be closed. No more messages will
392 // be sent, except for a Close.
393 bool closing_;
394
[email protected]992db4c2011-05-12 15:37:15395 // Whether this RenderWidget is currently swapped out, such that the view is
396 // being rendered by another process. If all RenderWidgets in a process are
397 // swapped out, the process can exit.
398 bool is_swapped_out_;
399
[email protected]fa7b1dc2010-06-23 17:53:04400 // Indicates if an input method is active in the browser process.
401 bool input_method_is_active_;
initial.commit09911bf2008-07-26 23:55:29402
[email protected]fa7b1dc2010-06-23 17:53:04403 // Stores the current text input type of |webwidget_|.
[email protected]ad26ef42011-06-17 07:59:45404 ui::TextInputType text_input_type_;
405
406 // Stores the current type of composition text rendering of |webwidget_|.
407 bool can_compose_inline_;
[email protected]fa7b1dc2010-06-23 17:53:04408
409 // Stores the current caret bounds of input focus.
410 WebKit::WebRect caret_bounds_;
initial.commit09911bf2008-07-26 23:55:29411
[email protected]3e2b375b2010-04-07 17:03:12412 // The kind of popup this widget represents, NONE if not a popup.
413 WebKit::WebPopupType popup_type_;
[email protected]0ebf3872008-11-07 21:35:03414
initial.commit09911bf2008-07-26 23:55:29415 // Holds all the needed plugin window moves for a scroll.
[email protected]191eb3f72010-12-21 06:27:50416 typedef std::vector<webkit::npapi::WebPluginGeometry> WebPluginGeometryVector;
[email protected]268654772009-08-06 23:02:04417 WebPluginGeometryVector plugin_window_moves_;
initial.commit09911bf2008-07-26 23:55:29418
[email protected]699ab0d2009-04-23 23:19:14419 // A custom background for the widget.
420 SkBitmap background_;
421
[email protected]2533ce12009-05-09 00:02:24422 // While we are waiting for the browser to update window sizes,
423 // we track the pending size temporarily.
424 int pending_window_rect_count_;
425 WebKit::WebRect pending_window_rect_;
426
[email protected]12fbad812009-09-01 18:21:24427 scoped_ptr<IPC::Message> pending_input_event_ack_;
428
[email protected]867125a02009-12-10 06:01:48429 // Indicates if the next sequence of Char events should be suppressed or not.
430 bool suppress_next_char_events_;
431
[email protected]a79d8a632010-11-18 22:35:56432 // Set to true if painting to the window is handled by the accelerated
433 // compositor.
434 bool is_accelerated_compositing_active_;
[email protected]edbcde932010-05-07 17:10:46435
[email protected]5f8b1022011-01-21 23:34:50436 base::Time animation_floor_time_;
437 bool animation_update_pending_;
[email protected]52ccd0ea2011-02-16 01:09:05438 bool animation_task_posted_;
[email protected]65225772011-05-12 21:10:24439 bool invalidation_task_posted_;
[email protected]5f8b1022011-01-21 23:34:50440
[email protected]bd37ae252011-06-03 01:28:18441 bool has_disable_gpu_vsync_switch_;
[email protected]0fb93f52011-05-18 23:13:56442 base::TimeTicks last_do_deferred_update_time_;
443
[email protected]05d478752009-04-08 23:38:16444 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
initial.commit09911bf2008-07-26 23:55:29445};
446
[email protected]2cff0052011-03-18 16:51:44447#endif // CONTENT_RENDERER_RENDER_WIDGET_H_