blob: 072da8cede16b9ebb57799b78270db633d0ae000 [file] [log] [blame]
[email protected]9f4f3322012-01-18 22:29:561// Copyright (c) 2012 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_
initial.commit09911bf2008-07-26 23:55:297
[email protected]aa4117f2011-12-09 22:19:218#include <deque>
[email protected]0e241b4b2012-08-18 09:06:279#include <map>
[email protected]010ea08a2009-10-11 20:21:3210
[email protected]8062ab262014-05-27 16:56:4311#include "base/auto_reset.h"
initial.commit09911bf2008-07-26 23:55:2912#include "base/basictypes.h"
[email protected]586871b2014-07-22 17:05:1113#include "base/callback.h"
[email protected]f3112a52011-09-30 23:47:4914#include "base/compiler_specific.h"
[email protected]3b63f8f42011-03-28 01:54:1515#include "base/memory/ref_counted.h"
[email protected]8704f89b2011-04-15 00:30:0516#include "base/memory/scoped_ptr.h"
[email protected]bffc8302014-01-23 20:52:1617#include "base/observer_list.h"
[email protected]abb522162013-06-28 01:54:1618#include "base/time/time.h"
[email protected]f3112a52011-09-30 23:47:4919#include "content/common/content_export.h"
[email protected]c2809346d2014-03-20 00:11:0320#include "content/common/cursors/webcursor.h"
[email protected]ed7defa2013-03-12 21:29:5921#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
[email protected]9017d7852013-11-21 17:47:3522#include "content/common/input/synthetic_gesture_params.h"
[email protected]586871b2014-07-22 17:05:1123#include "content/renderer/message_delivery_policy.h"
[email protected]4f86bdb2012-11-10 19:11:1924#include "ipc/ipc_listener.h"
25#include "ipc/ipc_sender.h"
[email protected]5c30b5e02013-05-30 03:46:0826#include "third_party/WebKit/public/platform/WebRect.h"
[email protected]2255a9332013-06-17 05:12:3127#include "third_party/WebKit/public/web/WebCompositionUnderline.h"
[email protected]c27dd4f2014-05-22 18:05:1928#include "third_party/WebKit/public/web/WebInputEvent.h"
[email protected]2255a9332013-06-17 05:12:3129#include "third_party/WebKit/public/web/WebPopupType.h"
30#include "third_party/WebKit/public/web/WebTextDirection.h"
31#include "third_party/WebKit/public/web/WebTextInputInfo.h"
[email protected]5d0bbdfa92013-12-10 00:35:5132#include "third_party/WebKit/public/web/WebTouchAction.h"
[email protected]0e45bd02013-07-12 20:20:0233#include "third_party/WebKit/public/web/WebWidget.h"
[email protected]2255a9332013-06-17 05:12:3134#include "third_party/WebKit/public/web/WebWidgetClient.h"
[email protected]d65adb12010-04-28 17:26:4935#include "third_party/skia/include/core/SkBitmap.h"
[email protected]b256eca2013-07-11 10:57:4036#include "ui/base/ime/text_input_mode.h"
[email protected]ad26ef42011-06-17 07:59:4537#include "ui/base/ime/text_input_type.h"
[email protected]a09d53ce2014-01-31 00:46:4238#include "ui/base/ui_base_types.h"
tfarina93bfa912014-12-05 14:23:1539#include "ui/gfx/geometry/rect.h"
40#include "ui/gfx/geometry/vector2d.h"
41#include "ui/gfx/geometry/vector2d_f.h"
[email protected]08397d52011-02-05 01:53:3842#include "ui/gfx/native_widget_types.h"
[email protected]db4fc1e2013-09-06 20:01:5143#include "ui/gfx/range/range.h"
[email protected]d353541f2012-05-03 22:45:4144#include "ui/surface/transport_dib.h"
initial.commit09911bf2008-07-26 23:55:2945
[email protected]aa4117f2011-12-09 22:19:2146struct ViewHostMsg_UpdateRect_Params;
[email protected]0fdd5012013-05-29 08:05:5647struct ViewMsg_Resize_Params;
[email protected]aa4117f2011-12-09 22:19:2148class ViewHostMsg_UpdateRect;
49
[email protected]484955942010-08-19 16:13:1850namespace IPC {
51class SyncMessage;
[email protected]586871b2014-07-22 17:05:1152class SyncMessageFilter;
[email protected]484955942010-08-19 16:13:1853}
54
[email protected]180ef242013-11-07 06:50:4655namespace blink {
[email protected]19193682014-04-03 15:01:4356struct WebDeviceEmulationParams;
kenrba7199832015-01-22 23:44:5957class WebFrameWidget;
[email protected]41d86852012-11-07 12:23:2458class WebGestureEvent;
[email protected]f56c7872013-06-18 12:31:5759class WebKeyboardEvent;
kenrba7199832015-01-22 23:44:5960class WebLocalFrame;
[email protected]6a8ddba52010-09-05 04:38:0661class WebMouseEvent;
donnda070f3c2015-01-16 19:54:1162class WebNode;
63struct WebPoint;
[email protected]2d0f2e92011-10-03 09:02:2464class WebTouchEvent;
kenrba7199832015-01-22 23:44:5965class WebView;
[email protected]526476902011-10-06 20:34:0666}
67
[email protected]586871b2014-07-22 17:05:1168namespace cc {
ccamerond4ba47902014-12-17 07:20:3169struct InputHandlerScrollResult;
[email protected]586871b2014-07-22 17:05:1170class OutputSurface;
71class SwapPromise;
72}
[email protected]ba91a792013-02-06 09:48:2873
[email protected]db4fc1e2013-09-06 20:01:5174namespace gfx {
[email protected]4de6d1692011-10-12 08:45:4475class Range;
76}
77
[email protected]e9ff79c2012-10-19 21:31:2678namespace content {
danakj6e3bf8012014-12-16 18:27:5379class CompositorDependencies;
[email protected]b2e4c70132013-10-03 02:07:5180class ExternalPopupMenu;
[email protected]586871b2014-07-22 17:05:1181class FrameSwapMessageQueue;
[email protected]adab2332013-07-25 18:04:3282class PepperPluginInstanceImpl;
[email protected]bffc8302014-01-23 20:52:1683class RenderFrameImpl;
[email protected]e3244ed2014-06-20 20:04:2784class RenderFrameProxy;
[email protected]ba91a792013-02-06 09:48:2885class RenderWidgetCompositor;
[email protected]e9ff79c2012-10-19 21:31:2686class RenderWidgetTest;
[email protected]5b45ad42013-10-25 00:42:0487class ResizingModeSelector;
[email protected]b2e4c70132013-10-03 02:07:5188struct ContextMenuParams;
[email protected]29e2fb42013-07-19 01:13:4789struct WebPluginGeometry;
[email protected]e9ff79c2012-10-19 21:31:2690
initial.commit09911bf2008-07-26 23:55:2991// RenderWidget provides a communication bridge between a WebWidget and
92// a RenderWidgetHost, the latter of which lives in a different process.
[email protected]f3112a52011-09-30 23:47:4993class CONTENT_EXPORT RenderWidget
[email protected]c47317e2012-06-20 22:35:3194 : public IPC::Listener,
95 public IPC::Sender,
[email protected]180ef242013-11-07 06:50:4696 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient),
[email protected]f3112a52011-09-30 23:47:4997 public base::RefCounted<RenderWidget> {
initial.commit09911bf2008-07-26 23:55:2998 public:
99 // Creates a new RenderWidget. The opener_id is the routing ID of the
[email protected]380244092011-10-07 17:26:27100 // RenderView that this widget lives inside.
[email protected]0ebf3872008-11-07 21:35:03101 static RenderWidget* Create(int32 opener_id,
danakj6e3bf8012014-12-16 18:27:53102 CompositorDependencies* compositor_deps,
[email protected]180ef242013-11-07 06:50:46103 blink::WebPopupType popup_type,
104 const blink::WebScreenInfo& screen_info);
initial.commit09911bf2008-07-26 23:55:29105
kenrba7199832015-01-22 23:44:59106 // Creates a new RenderWidget that will be attached to a RenderFrame.
107 static RenderWidget* CreateForFrame(int routing_id,
108 int surface_id,
109 bool hidden,
110 const blink::WebScreenInfo& screen_info,
111 CompositorDependencies* compositor_deps,
112 blink::WebLocalFrame* frame);
113
114 static blink::WebWidget* CreateWebFrameWidget(RenderWidget* render_widget,
115 blink::WebLocalFrame* frame);
116
[email protected]484955942010-08-19 16:13:18117 // Creates a WebWidget based on the popup type.
[email protected]180ef242013-11-07 06:50:46118 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget);
[email protected]484955942010-08-19 16:13:18119
[email protected]4ee64622014-03-21 22:34:15120 int32 routing_id() const { return routing_id_; }
121 int32 surface_id() const { return surface_id_; }
danakj6e3bf8012014-12-16 18:27:53122 CompositorDependencies* compositor_deps() const { return compositor_deps_; }
[email protected]180ef242013-11-07 06:50:46123 blink::WebWidget* webwidget() const { return webwidget_; }
[email protected]93b9d692011-04-13 00:44:31124 gfx::Size size() const { return size_; }
[email protected]589621b2010-09-23 22:01:07125 bool has_focus() const { return has_focus_; }
[email protected]ee41e7d22011-10-14 19:34:09126 bool is_fullscreen() const { return is_fullscreen_; }
[email protected]204f1df2012-01-04 20:21:13127 bool is_hidden() const { return is_hidden_; }
[email protected]4ee64622014-03-21 22:34:15128 bool handling_input_event() const { return handling_input_event_; }
129 // Temporary for debugging purposes...
130 bool closing() const { return closing_; }
131 bool is_swapped_out() { return is_swapped_out_; }
132 ui::MenuSourceType context_menu_source_type() {
[email protected]be1af0662014-07-29 19:55:51133 return context_menu_source_type_;
134 }
135 bool has_host_context_menu_location() {
136 return has_host_context_menu_location_;
137 }
138 gfx::Point host_context_menu_location() {
139 return host_context_menu_location_;
[email protected]4ee64622014-03-21 22:34:15140 }
[email protected]589621b2010-09-23 22:01:07141
kenrba7199832015-01-22 23:44:59142 // ScreenInfo exposed so it can be passed to subframe RenderWidgets.
143 blink::WebScreenInfo screen_info() const { return screen_info_; }
144
[email protected]bffc8302014-01-23 20:52:16145 // Functions to track out-of-process frames for special notifications.
[email protected]e3244ed2014-06-20 20:04:27146 void RegisterRenderFrameProxy(RenderFrameProxy* proxy);
147 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy);
[email protected]bffc8302014-01-23 20:52:16148
[email protected]de3c5d82014-05-28 22:12:59149 // Functions to track all RenderFrame objects associated with this
150 // RenderWidget.
151 void RegisterRenderFrame(RenderFrameImpl* frame);
152 void UnregisterRenderFrame(RenderFrameImpl* frame);
153
[email protected]a017938b2014-05-27 21:17:17154#if defined(VIDEO_HOLE)
155 void RegisterVideoHoleFrame(RenderFrameImpl* frame);
156 void UnregisterVideoHoleFrame(RenderFrameImpl* frame);
157#endif // defined(VIDEO_HOLE)
158
[email protected]c47317e2012-06-20 22:35:31159 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52160 bool OnMessageReceived(const IPC::Message& msg) override;
initial.commit09911bf2008-07-26 23:55:29161
[email protected]c47317e2012-06-20 22:35:31162 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52163 bool Send(IPC::Message* msg) override;
initial.commit09911bf2008-07-26 23:55:29164
[email protected]180ef242013-11-07 06:50:46165 // blink::WebWidgetClient
[email protected]9cd43a62012-03-26 08:03:56166 virtual void willBeginCompositorFrame();
[email protected]180ef242013-11-07 06:50:46167 virtual void didAutoResize(const blink::WebSize& new_size);
[email protected]e195e582013-03-08 01:32:59168 virtual void initializeLayerTreeView();
[email protected]180ef242013-11-07 06:50:46169 virtual blink::WebLayerTreeView* layerTreeView();
[email protected]3391a0772012-03-28 00:32:07170 virtual void didBecomeReadyForAdditionalInput();
[email protected]58264a32011-11-17 23:36:15171 virtual void didCommitAndDrawCompositorFrame();
172 virtual void didCompleteSwapBuffers();
[email protected]8b9e52b2014-01-17 16:35:31173 virtual void scheduleComposite();
[email protected]4873c7d2009-07-16 06:36:28174 virtual void didFocus();
175 virtual void didBlur();
[email protected]180ef242013-11-07 06:50:46176 virtual void didChangeCursor(const blink::WebCursorInfo&);
[email protected]4873c7d2009-07-16 06:36:28177 virtual void closeWidgetSoon();
[email protected]180ef242013-11-07 06:50:46178 virtual void show(blink::WebNavigationPolicy);
[email protected]180ef242013-11-07 06:50:46179 virtual blink::WebRect windowRect();
180 virtual void setToolTipText(const blink::WebString& text,
181 blink::WebTextDirection hint);
182 virtual void setWindowRect(const blink::WebRect&);
183 virtual blink::WebRect windowResizerRect();
184 virtual blink::WebRect rootWindowRect();
185 virtual blink::WebScreenInfo screenInfo();
[email protected]f660d9c2012-06-06 18:31:21186 virtual float deviceScaleFactor();
[email protected]fa7b1dc2010-06-23 17:53:04187 virtual void resetInputMethod();
[email protected]180ef242013-11-07 06:50:46188 virtual void didHandleGestureEvent(const blink::WebGestureEvent& event,
[email protected]c68c3e4e2013-01-24 00:36:56189 bool event_cancelled);
[email protected]adb362312014-06-28 06:04:24190 virtual void showImeIfNeeded();
[email protected]4873c7d2009-07-16 06:36:28191
donnda070f3c2015-01-16 19:54:11192#if defined(OS_ANDROID)
193 // Notifies that a tap was not consumed, so showing a UI for the unhandled
194 // tap may be needed.
donnd57e54f52015-02-26 19:03:37195 // Performs various checks on the given WebNode to apply heuristics to
196 // determine if triggering is appropriate.
donnda070f3c2015-01-16 19:54:11197 virtual void showUnhandledTapUIIfNeeded(
198 const blink::WebPoint& tapped_position,
199 const blink::WebNode& tapped_node,
200 bool page_changed) override;
201#endif
202
[email protected]7912e822014-04-16 02:37:03203 // Begins the compositor's scheduler to start producing frames.
204 void StartCompositor();
205
[email protected]aeeedad2014-08-22 18:16:22206 // Stop compositing.
ennef3c58142014-12-09 21:44:38207 void WillCloseLayerTreeView();
[email protected]aeeedad2014-08-22 18:16:22208
[email protected]4873c7d2009-07-16 06:36:28209 // Called when a plugin is moved. These events are queued up and sent with
210 // the next paint or scroll message to the host.
[email protected]29e2fb42013-07-19 01:13:47211 void SchedulePluginMove(const WebPluginGeometry& move);
initial.commit09911bf2008-07-26 23:55:29212
[email protected]268654772009-08-06 23:02:04213 // Called when a plugin window has been destroyed, to make sure the currently
214 // pending moves don't try to reference it.
215 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window);
216
[email protected]24ed0432013-04-24 07:50:31217 RenderWidgetCompositor* compositor() const;
218
[email protected]8062ab262014-05-27 16:56:43219 const ui::LatencyInfo* current_event_latency_info() const {
220 return current_event_latency_info_;
221 }
222
[email protected]ebc0e1df2013-08-01 02:46:22223 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback);
[email protected]ba91a792013-02-06 09:48:28224
[email protected]79fa22e2013-08-23 15:18:12225 // Callback for use with synthetic gestures (e.g. BeginSmoothScroll).
226 typedef base::Callback<void()> SyntheticGestureCompletionCallback;
[email protected]0e241b4b2012-08-18 09:06:27227
[email protected]9017d7852013-11-21 17:47:35228 // Send a synthetic gesture to the browser to be queued to the synthetic
229 // gesture controller.
230 void QueueSyntheticGesture(
231 scoped_ptr<SyntheticGestureParams> gesture_params,
232 const SyntheticGestureCompletionCallback& callback);
[email protected]1e1dd182013-09-12 01:51:15233
initial.commit09911bf2008-07-26 23:55:29234 // Close the underlying WebWidget.
[email protected]60c42a8c72009-10-09 04:08:59235 virtual void Close();
initial.commit09911bf2008-07-26 23:55:29236
[email protected]6fceb912013-02-15 06:24:15237 // Notifies about a compositor frame commit operation having finished.
238 virtual void DidCommitCompositorFrame();
239
[email protected]586871b2014-07-22 17:05:11240 // Deliveres |message| together with compositor state change updates. The
241 // exact behavior depends on |policy|.
242 // This mechanism is not a drop-in replacement for IPC: messages sent this way
243 // will not be automatically available to BrowserMessageFilter, for example.
244 // FIFO ordering is preserved between messages enqueued with the same
245 // |policy|, the ordering between messages enqueued for different policies is
246 // undefined.
247 //
248 // |msg| message to send, ownership of |msg| is transferred.
249 // |policy| see the comment on MessageDeliveryPolicy.
250 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy);
251
[email protected]66fca5bc2013-05-23 06:58:29252 // Handle common setup/teardown for handling IME events.
253 void StartHandlingImeEvent();
254 void FinishHandlingImeEvent();
255
[email protected]4ee64622014-03-21 22:34:15256 // Returns whether we currently should handle an IME event.
257 bool ShouldHandleImeEvent();
258
rouslanf7ebd8832015-01-22 01:54:14259 // Called by the compositor when page scale animation completed.
260 virtual void DidCompletePageScaleAnimation() {}
261
[email protected]c27dd4f2014-05-22 18:05:19262 // When paused in debugger, we send ack for mouse event early. This ensures
263 // that we continue receiving mouse moves and pass them to debugger. Returns
264 // whether we are paused in mouse move event and have sent the ack.
265 bool SendAckForMouseMoveFromDebugger();
266
267 // When resumed from pause in debugger while handling mouse move,
268 // we should not send an extra ack (see SendAckForMouseMoveFromDebugger).
269 void IgnoreAckForMouseMoveFromDebugger();
270
[email protected]b2e4c70132013-10-03 02:07:51271 // ScreenMetricsEmulator class manages screen emulation inside a render
272 // widget. This includes resizing, placing view on the screen at desired
273 // position, changing device scale factor, and scaling down the whole
274 // widget if required to fit into the browser window.
275 class ScreenMetricsEmulator;
276
[email protected]b2e4c70132013-10-03 02:07:51277 void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator);
[email protected]2d6836f42014-07-02 17:25:31278 gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor);
[email protected]b2e4c70132013-10-03 02:07:51279
[email protected]7d08a9352013-10-15 08:24:56280 void ScheduleCompositeWithForcedRedraw();
281
[email protected]4d7e46a2013-11-08 05:33:40282 // Called by the compositor in single-threaded mode when a swap is posted,
283 // completes or is aborted.
284 void OnSwapBuffersPosted();
285 void OnSwapBuffersComplete();
286 void OnSwapBuffersAborted();
287
shuchen3517bb62014-10-15 03:55:57288 // Checks if the text input state and compose inline mode have been changed.
289 // If they are changed, the new value will be sent to the browser process.
290 void UpdateTextInputType();
291
[email protected]7a4e2532013-12-02 21:30:02292 // Checks if the selection bounds have been changed. If they are changed,
293 // the new value will be sent to the browser process.
294 void UpdateSelectionBounds();
295
[email protected]e5e438d62014-03-27 21:47:16296 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end);
297
[email protected]a09d53ce2014-01-31 00:46:42298 void OnShowHostContextMenu(ContextMenuParams* params);
[email protected]7a4e2532013-12-02 21:30:02299
shuchen3517bb62014-10-15 03:55:57300#if defined(OS_ANDROID) || defined(USE_AURA)
[email protected]90f24152014-04-09 12:41:36301 enum ShowIme {
302 SHOW_IME_IF_NEEDED,
303 NO_SHOW_IME,
304 };
305
306 enum ChangeSource {
307 FROM_NON_IME,
308 FROM_IME,
309 };
310
311 // |show_ime| should be SHOW_IME_IF_NEEDED iff the update may cause the ime to
312 // be displayed, e.g. after a tap on an input field on mobile.
313 // |change_source| should be FROM_NON_IME when the renderer has to wait for
314 // the browser to acknowledge the change before the renderer handles any more
315 // IME events. This is when the text change did not originate from the IME in
316 // the browser side, such as changes by JavaScript or autofill.
317 void UpdateTextInputState(ShowIme show_ime, ChangeSource change_source);
shuchen3517bb62014-10-15 03:55:57318#endif
[email protected]4ee64622014-03-21 22:34:15319
rouslanf7ebd8832015-01-22 01:54:14320 // Called when animations due to focus change have completed (if any). Can be
321 // called from the renderer, browser, or compositor.
322 virtual void FocusChangeComplete() {}
323
[email protected]7a4e2532013-12-02 21:30:02324 // Checks if the composition range or composition character bounds have been
325 // changed. If they are changed, the new value will be sent to the browser
yukawa5f21c6a2014-10-27 17:09:30326 // process. This method does nothing when the browser process is not able to
327 // handle composition range and composition character bounds.
[email protected]7a4e2532013-12-02 21:30:02328 void UpdateCompositionInfo(bool should_update_range);
[email protected]7a4e2532013-12-02 21:30:02329
[email protected]a4f0d882014-05-01 23:48:10330#if defined(OS_ANDROID)
331 void DidChangeBodyBackgroundColor(SkColor bg_color);
timav7a5032e2014-12-05 01:59:43332 bool DoesRecordFullLayer() const;
[email protected]a4f0d882014-05-01 23:48:10333#endif
334
ennef3c58142014-12-09 21:44:38335 bool host_closing() const { return host_closing_; }
336
initial.commit09911bf2008-07-26 23:55:29337 protected:
[email protected]8085dbc82008-09-26 22:53:44338 // Friend RefCounted so that the dtor can be non-public. Using this class
339 // without ref-counting is an error.
340 friend class base::RefCounted<RenderWidget>;
[email protected]7339cd22010-10-27 00:11:20341 // For unit tests.
[email protected]e9ff79c2012-10-19 21:31:26342 friend class RenderWidgetTest;
[email protected]8085dbc82008-09-26 22:53:44343
[email protected]61e2b3cc2012-03-02 16:13:34344 enum ResizeAck {
345 SEND_RESIZE_ACK,
346 NO_RESIZE_ACK,
347 };
348
[email protected]180ef242013-11-07 06:50:46349 RenderWidget(blink::WebPopupType popup_type,
350 const blink::WebScreenInfo& screen_info,
[email protected]1ac10dca2013-08-20 20:47:04351 bool swapped_out,
[email protected]7912e822014-04-16 02:37:03352 bool hidden,
353 bool never_visible);
[email protected]ce2b28e2012-08-09 15:53:57354
dcheng6d18e402014-10-21 12:32:52355 ~RenderWidget() override;
initial.commit09911bf2008-07-26 23:55:29356
357 // Initializes this view with the given opener. CompleteInit must be called
358 // later.
danakj6e3bf8012014-12-16 18:27:53359 bool Init(int32 opener_id, CompositorDependencies* compositor_deps);
initial.commit09911bf2008-07-26 23:55:29360
[email protected]484955942010-08-19 16:13:18361 // Called by Init and subclasses to perform initialization.
[email protected]a635f942012-12-07 10:34:29362 bool DoInit(int32 opener_id,
danakj6e3bf8012014-12-16 18:27:53363 CompositorDependencies* compositor_deps,
[email protected]180ef242013-11-07 06:50:46364 blink::WebWidget* web_widget,
[email protected]484955942010-08-19 16:13:18365 IPC::SyncMessage* create_widget_message);
366
initial.commit09911bf2008-07-26 23:55:29367 // Finishes creation of a pending view started with Init.
[email protected]fc4404d2012-11-07 19:53:30368 void CompleteInit();
initial.commit09911bf2008-07-26 23:55:29369
[email protected]992db4c2011-05-12 15:37:15370 // Sets whether this RenderWidget has been swapped out to be displayed by
371 // a RenderWidget in a different process. If so, no new IPC messages will be
372 // sent (only ACKs) and the process is free to exit when there are no other
373 // active RenderWidgets.
374 void SetSwappedOut(bool is_swapped_out);
375
[email protected]949b6592014-08-20 13:17:52376 // Allows the process to exit once the unload handler has finished, if there
377 // are no other active RenderWidgets.
378 void WasSwappedOut();
379
[email protected]fd847792013-10-24 17:12:35380 void FlushPendingInputEventAck();
[email protected]2533ce12009-05-09 00:02:24381 void DoDeferredClose();
[email protected]180ef242013-11-07 06:50:46382 void DoDeferredSetWindowRect(const blink::WebRect& pos);
dgozmancf9039cd2015-04-06 12:01:31383 void NotifyOnClose();
initial.commit09911bf2008-07-26 23:55:29384
[email protected]61e2b3cc2012-03-02 16:13:34385 // Resizes the render widget.
386 void Resize(const gfx::Size& new_size,
[email protected]60d47ac2013-03-01 23:42:44387 const gfx::Size& physical_backing_size,
dtrainorcb7779b82014-12-04 01:08:02388 bool top_controls_shrink_blink_size,
389 float top_controls_height,
[email protected]bb6378fe2014-04-28 21:19:44390 const gfx::Size& visible_viewport_size,
[email protected]61e2b3cc2012-03-02 16:13:34391 const gfx::Rect& resizer_rect,
392 bool is_fullscreen,
393 ResizeAck resize_ack);
[email protected]92650162013-10-30 03:31:02394 // Used to force the size of a window when running layout tests.
bokanc007c3a2015-02-03 07:15:56395 void SetWindowRectSynchronously(const gfx::Rect& new_window_rect);
[email protected]b2e4c70132013-10-03 02:07:51396 virtual void SetScreenMetricsEmulationParameters(
dgozman9260b0a12015-03-16 13:45:20397 bool enabled,
398 const blink::WebDeviceEmulationParams& params);
[email protected]53907862014-03-25 15:42:40399#if defined(OS_MACOSX) || defined(OS_ANDROID)
[email protected]b2e4c70132013-10-03 02:07:51400 void SetExternalPopupOriginAdjustmentsForEmulation(
401 ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator);
[email protected]53907862014-03-25 15:42:40402#endif
[email protected]61e2b3cc2012-03-02 16:13:34403
initial.commit09911bf2008-07-26 23:55:29404 // RenderWidget IPC message handlers
[email protected]180ef242013-11-07 06:50:46405 void OnHandleInputEvent(const blink::WebInputEvent* event,
[email protected]205294b2014-03-18 20:48:35406 const ui::LatencyInfo& latency_info,
[email protected]c084330e02013-04-27 01:08:15407 bool keyboard_shortcut);
[email protected]34202de2013-05-06 23:36:22408 void OnCursorVisibilityChange(bool is_visible);
[email protected]c084330e02013-04-27 01:08:15409 void OnMouseCaptureLost();
410 virtual void OnSetFocus(bool enable);
[email protected]6de7fc482014-06-06 10:46:44411 virtual void OnClose();
[email protected]fc4404d2012-11-07 19:53:30412 void OnCreatingNewAck();
[email protected]0fdd5012013-05-29 08:05:56413 virtual void OnResize(const ViewMsg_Resize_Params& params);
dgozman9260b0a12015-03-16 13:45:20414 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params);
415 void OnDisableDeviceEmulation();
noel89949e62014-09-30 01:12:41416 void OnColorProfile(const std::vector<char>& color_profile);
[email protected]b5913d72012-02-07 22:26:54417 void OnChangeResizeRect(const gfx::Rect& resizer_rect);
[email protected]941e4552010-02-01 21:23:43418 virtual void OnWasHidden();
[email protected]3399dd822014-08-09 11:14:24419 virtual void OnWasShown(bool needs_repainting,
420 const ui::LatencyInfo& latency_info);
[email protected]8400e032010-02-26 18:50:11421 void OnCreateVideoAck(int32 video_id);
422 void OnUpdateVideoAck(int32 video_id);
[email protected]2533ce12009-05-09 00:02:24423 void OnRequestMoveAck();
[email protected]fa7b1dc2010-06-23 17:53:04424 void OnSetInputMethodActive(bool is_active);
[email protected]37a241c2013-12-03 03:16:17425 void OnCandidateWindowShown();
426 void OnCandidateWindowUpdated();
427 void OnCandidateWindowHidden();
[email protected]56ea1a62011-05-30 07:05:57428 virtual void OnImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26429 const base::string16& text,
[email protected]180ef242013-11-07 06:50:46430 const std::vector<blink::WebCompositionUnderline>& underlines,
[email protected]fa7b1dc2010-06-23 17:53:04431 int selection_start,
432 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26433 virtual void OnImeConfirmComposition(const base::string16& text,
[email protected]db4fc1e2013-09-06 20:01:51434 const gfx::Range& replacement_range,
[email protected]0e45bd02013-07-12 20:20:02435 bool keep_selection);
[email protected]0bc1f572013-04-17 01:46:31436 void OnRepaint(gfx::Size size_to_paint);
[email protected]79fa22e2013-08-23 15:18:12437 void OnSyntheticGestureCompleted();
[email protected]180ef242013-11-07 06:50:46438 void OnSetTextDirection(blink::WebTextDirection direction);
[email protected]872ae5b2011-05-26 20:20:50439 void OnGetFPS();
[email protected]80ad8622012-11-07 16:33:03440 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
441 const gfx::Rect& window_screen_rect);
[email protected]2384b6c2013-02-28 23:58:51442 void OnShowImeIfNeeded();
[email protected]0d1ebed12013-08-05 22:01:13443
[email protected]adb362312014-06-28 06:04:24444#if defined(OS_ANDROID)
[email protected]0d1ebed12013-08-05 22:01:13445 // Whenever an IME event that needs an acknowledgement is sent to the browser,
446 // the number of outstanding IME events that needs acknowledgement should be
447 // incremented. All IME events will be dropped until we receive an ack from
448 // the browser.
449 void IncrementOutstandingImeEventAcks();
450
451 // Called by the browser process for every required IME acknowledgement.
452 void OnImeEventAck();
[email protected]105dffb42013-02-20 03:46:21453#endif
[email protected]0d1ebed12013-08-05 22:01:13454
[email protected]847a2582013-03-09 02:29:51455 // Notify the compositor about a change in viewport size. This should be
456 // used only with auto resize mode WebWidgets, as normal WebWidgets should
457 // go through OnResize.
[email protected]97e1bf72013-03-06 14:06:05458 void AutoResizeCompositor();
459
[email protected]468ac582012-11-20 00:53:19460 virtual void SetDeviceScaleFactor(float device_scale_factor);
[email protected]28ed6b32014-06-08 02:16:27461 virtual bool SetDeviceColorProfile(const std::vector<char>& color_profile);
noeldb4df152014-09-16 17:45:20462 virtual void ResetDeviceColorProfileForTesting();
[email protected]468ac582012-11-20 00:53:19463
[email protected]fcdc5642014-05-09 14:32:24464 virtual void OnOrientationChange();
465
[email protected]29ed96a2012-02-04 18:12:16466 // Override points to notify derived classes that a paint has happened.
[email protected]0704ac32013-10-03 15:24:22467 // DidInitiatePaint happens when that has completed, and subsequent rendering
468 // won't affect the painted content. DidFlushPaint happens once we've received
469 // the ACK that the screen has been updated. For a given paint operation,
470 // these overrides will always be called in the order DidInitiatePaint,
471 // DidFlushPaint.
[email protected]00c39612010-03-06 02:53:28472 virtual void DidInitiatePaint() {}
473 virtual void DidFlushPaint() {}
[email protected]a2f6bc112009-06-27 16:27:25474
[email protected]ed7defa2013-03-12 21:29:59475 virtual GURL GetURLForGraphicsContext3D();
[email protected]65225772011-05-12 21:10:24476
[email protected]d54169e92011-01-21 09:19:52477 // Gets the scroll offset of this widget, if this widget has a notion of
478 // scroll offset.
[email protected]ceb36f7d2012-10-31 18:33:24479 virtual gfx::Vector2d GetScrollOffset();
[email protected]d54169e92011-01-21 09:19:52480
[email protected]bee16aab2009-08-26 15:55:03481 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
482 // use this method so that we can properly inform the RenderThread of our
483 // state.
484 void SetHidden(bool hidden);
485
[email protected]2b624c562011-10-27 22:58:26486 void WillToggleFullscreen();
487 void DidToggleFullscreen();
488
[email protected]674741932009-02-04 23:44:46489 bool next_paint_is_resize_ack() const;
[email protected]674741932009-02-04 23:44:46490 void set_next_paint_is_resize_ack();
[email protected]674741932009-02-04 23:44:46491 void set_next_paint_is_repaint_ack();
[email protected]ec7dc112008-08-06 05:30:12492
[email protected]586871b2014-07-22 17:05:11493 // QueueMessage implementation extracted into a static method for easy
494 // testing.
495 static scoped_ptr<cc::SwapPromise> QueueMessageImpl(
496 IPC::Message* msg,
497 MessageDeliveryPolicy policy,
498 FrameSwapMessageQueue* frame_swap_message_queue,
499 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter,
[email protected]586871b2014-07-22 17:05:11500 int source_frame_number);
501
[email protected]56ea1a62011-05-30 07:05:57502 // Override point to obtain that the current input method state and caret
503 // position.
[email protected]ad26ef42011-06-17 07:59:45504 virtual ui::TextInputType GetTextInputType();
[email protected]5b739cb2012-08-21 20:35:21505 virtual ui::TextInputType WebKitToUiTextInputType(
[email protected]180ef242013-11-07 06:50:46506 blink::WebTextInputType type);
[email protected]ad26ef42011-06-17 07:59:45507
[email protected]58b48a0d2012-06-13 07:01:35508 // Override point to obtain that the current composition character bounds.
509 // In the case of surrogate pairs, the character is treated as two characters:
510 // the bounds for first character is actual one, and the bounds for second
511 // character is zero width rectangle.
512 virtual void GetCompositionCharacterBounds(
513 std::vector<gfx::Rect>* character_bounds);
514
[email protected]88dbe32f2013-06-20 23:31:36515 // Returns the range of the text that is being composed or the selection if
516 // the composition does not exist.
[email protected]db4fc1e2013-09-06 20:01:51517 virtual void GetCompositionRange(gfx::Range* range);
[email protected]88dbe32f2013-06-20 23:31:36518
[email protected]58b48a0d2012-06-13 07:01:35519 // Returns true if the composition range or composition character bounds
520 // should be sent to the browser process.
521 bool ShouldUpdateCompositionInfo(
[email protected]db4fc1e2013-09-06 20:01:51522 const gfx::Range& range,
[email protected]58b48a0d2012-06-13 07:01:35523 const std::vector<gfx::Rect>& bounds);
524
[email protected]ad26ef42011-06-17 07:59:45525 // Override point to obtain that the current input method state about
526 // composition text.
527 virtual bool CanComposeInline();
[email protected]56ea1a62011-05-30 07:05:57528
initial.commit09911bf2008-07-26 23:55:29529 // Tells the renderer it does not have focus. Used to prevent us from getting
530 // the focus on our own when the browser did not focus us.
531 void ClearFocus();
532
[email protected]2533ce12009-05-09 00:02:24533 // Set the pending window rect.
534 // Because the real render_widget is hosted in another process, there is
535 // a time period where we may have set a new window rect which has not yet
536 // been processed by the browser. So we maintain a pending window rect
537 // size. If JS code sets the WindowRect, and then immediately calls
538 // GetWindowRect() we'll use this pending window rect as the size.
[email protected]180ef242013-11-07 06:50:46539 void SetPendingWindowRect(const blink::WebRect& r);
[email protected]2533ce12009-05-09 00:02:24540
[email protected]446705872009-09-10 07:22:48541 // Called by OnHandleInputEvent() to notify subclasses that a key event was
542 // just handled.
543 virtual void DidHandleKeyEvent() {}
544
[email protected]67bfb83f2011-09-22 03:36:37545 // Called by OnHandleInputEvent() to notify subclasses that a mouse event is
546 // about to be handled.
547 // Returns true if no further handling is needed. In that case, the event
548 // won't be sent to WebKit or trigger DidHandleMouseEvent().
[email protected]180ef242013-11-07 06:50:46549 virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event);
[email protected]67bfb83f2011-09-22 03:36:37550
[email protected]41d86852012-11-07 12:23:24551 // Called by OnHandleInputEvent() to notify subclasses that a gesture event is
552 // about to be handled.
553 // Returns true if no further handling is needed. In that case, the event
554 // won't be sent to WebKit.
[email protected]180ef242013-11-07 06:50:46555 virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event);
[email protected]41d86852012-11-07 12:23:24556
[email protected]6a8ddba52010-09-05 04:38:06557 // Called by OnHandleInputEvent() to notify subclasses that a mouse event was
558 // just handled.
[email protected]180ef242013-11-07 06:50:46559 virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {}
[email protected]6a8ddba52010-09-05 04:38:06560
[email protected]2d0f2e92011-10-03 09:02:24561 // Called by OnHandleInputEvent() to notify subclasses that a touch event was
562 // just handled.
[email protected]180ef242013-11-07 06:50:46563 virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {}
[email protected]2d0f2e92011-10-03 09:02:24564
ccamerond4ba47902014-12-17 07:20:31565 // Called by OnHandleInputEvent() to forward a mouse wheel event to the
566 // compositor thread, to effect the elastic overscroll effect.
ccamerona7644752014-12-30 01:16:31567 void ObserveWheelEventAndResult(const blink::WebMouseWheelEvent& wheel_event,
568 bool event_processed);
ccamerond4ba47902014-12-17 07:20:31569
[email protected]3d5c243b2012-11-30 00:26:01570 // Check whether the WebWidget has any touch event handlers registered
571 // at the given point.
572 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const;
573
[email protected]ce6689f2013-03-29 12:52:55574 // Check whether the WebWidget has any touch event handlers registered.
575 virtual void hasTouchEventHandlers(bool has_handlers);
576
[email protected]5d0bbdfa92013-12-10 00:35:51577 // Tell the browser about the actions permitted for a new touch point.
578 virtual void setTouchAction(blink::WebTouchAction touch_action);
579
[email protected]90f24152014-04-09 12:41:36580 // Called when value of focused text field gets dirty, e.g. value is modified
581 // by script, not by user input.
582 virtual void didUpdateTextOfFocusedElementByNonUserInput();
583
[email protected]ed7defa2013-03-12 21:29:59584 // Creates a 3D context associated with this view.
[email protected]828a3932014-04-02 14:43:13585 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D();
[email protected]ed7defa2013-03-12 21:29:59586
initial.commit09911bf2008-07-26 23:55:29587 // Routing ID that allows us to communicate to the parent browser process
588 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
589 int32 routing_id_;
590
[email protected]9f4f3322012-01-18 22:29:56591 int32 surface_id_;
592
danakj6e3bf8012014-12-16 18:27:53593 // Dependencies for initializing a compositor, including flags for optional
594 // features.
595 CompositorDependencies* compositor_deps_;
596
[email protected]c5b3b5e2009-02-13 06:41:11597 // We are responsible for destroying this object via its Close method.
[email protected]4ee64622014-03-21 22:34:15598 // May be NULL when the window is closing.
[email protected]180ef242013-11-07 06:50:46599 blink::WebWidget* webwidget_;
initial.commit09911bf2008-07-26 23:55:29600
[email protected]8926c602013-01-23 05:32:06601 // This is lazily constructed and must not outlive webwidget_.
[email protected]ba91a792013-02-06 09:48:28602 scoped_ptr<RenderWidgetCompositor> compositor_;
[email protected]8926c602013-01-23 05:32:06603
initial.commit09911bf2008-07-26 23:55:29604 // Set to the ID of the view that initiated creating this view, if any. When
605 // the view was initiated by the browser (the common case), this will be
606 // MSG_ROUTING_NONE. This is used in determining ownership when opening
607 // child tabs. See RenderWidget::createWebViewWithRequest.
608 //
609 // This ID may refer to an invalid view if that view is closed before this
610 // view is.
611 int32 opener_id_;
612
bokanc007c3a2015-02-03 07:15:56613 // The rect where this view should be initially shown.
614 gfx::Rect initial_rect_;
initial.commit09911bf2008-07-26 23:55:29615
[email protected]fc4404d2012-11-07 19:53:30616 bool init_complete_;
initial.commit09911bf2008-07-26 23:55:29617
618 // We store the current cursor object so we can avoid spamming SetCursor
619 // messages.
620 WebCursor current_cursor_;
[email protected]88efb7ec2009-07-14 16:32:59621
initial.commit09911bf2008-07-26 23:55:29622 // The size of the RenderWidget.
623 gfx::Size size_;
624
[email protected]60d47ac2013-03-01 23:42:44625 // The size of the view's backing surface in non-DPI-adjusted pixels.
626 gfx::Size physical_backing_size_;
627
dtrainorcb7779b82014-12-04 01:08:02628 // Whether or not Blink's viewport size should be shrunk by the height of the
629 // URL-bar (always false on platforms where URL-bar hiding isn't supported).
630 bool top_controls_shrink_blink_size_;
631
632 // The height of the top controls (always 0 on platforms where URL-bar hiding
633 // isn't supported).
634 float top_controls_height_;
[email protected]d9083762013-03-24 01:36:40635
[email protected]bb6378fe2014-04-28 21:19:44636 // The size of the visible viewport in DPI-adjusted pixels.
637 gfx::Size visible_viewport_size_;
638
[email protected]f21c613a2009-02-12 14:46:17639 // The area that must be reserved for drawing the resize corner.
640 gfx::Rect resizer_rect_;
641
[email protected]53d3f302009-12-21 04:42:05642 // Flags for the next ViewHostMsg_UpdateRect message.
initial.commit09911bf2008-07-26 23:55:29643 int next_paint_flags_;
644
[email protected]847a2582013-03-09 02:29:51645 // Whether the WebWidget is in auto resize mode, which is used for example
646 // by extension popups.
647 bool auto_resize_mode_;
648
[email protected]ea3ee0a2012-05-15 03:43:09649 // True if we need to send an UpdateRect message to notify the browser about
650 // an already-completed auto-resize.
651 bool need_update_rect_for_auto_resize_;
652
initial.commit09911bf2008-07-26 23:55:29653 // Set to true if we should ignore RenderWidget::Show calls.
654 bool did_show_;
655
656 // Indicates that we shouldn't bother generated paint events.
657 bool is_hidden_;
658
[email protected]7912e822014-04-16 02:37:03659 // Indicates that we are never visible, so never produce graphical output.
660 bool never_visible_;
661
[email protected]ee41e7d22011-10-14 19:34:09662 // Indicates that we are in fullscreen mode.
663 bool is_fullscreen_;
664
initial.commit09911bf2008-07-26 23:55:29665 // Indicates whether we have been focused/unfocused by the browser.
666 bool has_focus_;
667
[email protected]5dd768212009-08-13 23:34:49668 // Are we currently handling an input event?
669 bool handling_input_event_;
670
[email protected]e8f775f2013-02-14 21:00:50671 // Are we currently handling an ime event?
672 bool handling_ime_event_;
673
[email protected]c27dd4f2014-05-22 18:05:19674 // Type of the input event we are currently handling.
675 blink::WebInputEvent::Type handling_event_type_;
676
677 // Whether we should not send ack for the current mouse move.
678 bool ignore_ack_for_mouse_move_from_debugger_;
[email protected]5d0bbdfa92013-12-10 00:35:51679
initial.commit09911bf2008-07-26 23:55:29680 // True if we have requested this widget be closed. No more messages will
681 // be sent, except for a Close.
682 bool closing_;
683
[email protected]aeeedad2014-08-22 18:16:22684 // True if it is known that the host is in the process of being shut down.
685 bool host_closing_;
686
[email protected]992db4c2011-05-12 15:37:15687 // Whether this RenderWidget is currently swapped out, such that the view is
688 // being rendered by another process. If all RenderWidgets in a process are
689 // swapped out, the process can exit.
690 bool is_swapped_out_;
691
[email protected]fa7b1dc2010-06-23 17:53:04692 // Indicates if an input method is active in the browser process.
693 bool input_method_is_active_;
initial.commit09911bf2008-07-26 23:55:29694
[email protected]5b739cb2012-08-21 20:35:21695 // Stores information about the current text input.
[email protected]180ef242013-11-07 06:50:46696 blink::WebTextInputInfo text_input_info_;
[email protected]5b739cb2012-08-21 20:35:21697
[email protected]fa7b1dc2010-06-23 17:53:04698 // Stores the current text input type of |webwidget_|.
[email protected]ad26ef42011-06-17 07:59:45699 ui::TextInputType text_input_type_;
700
[email protected]b256eca2013-07-11 10:57:40701 // Stores the current text input mode of |webwidget_|.
702 ui::TextInputMode text_input_mode_;
703
shuchen82ce8c52014-10-23 01:55:20704 // Stores the current text input flags of |webwidget_|.
705 int text_input_flags_;
706
[email protected]86ba5fcb2013-09-04 00:36:53707 // Stores the current type of composition text rendering of |webwidget_|.
708 bool can_compose_inline_;
709
[email protected]e99ef6f2011-10-16 01:13:00710 // Stores the current selection bounds.
[email protected]7c8873e2013-02-05 08:03:01711 gfx::Rect selection_focus_rect_;
712 gfx::Rect selection_anchor_rect_;
initial.commit09911bf2008-07-26 23:55:29713
[email protected]58b48a0d2012-06-13 07:01:35714 // Stores the current composition character bounds.
715 std::vector<gfx::Rect> composition_character_bounds_;
716
717 // Stores the current composition range.
[email protected]db4fc1e2013-09-06 20:01:51718 gfx::Range composition_range_;
[email protected]58b48a0d2012-06-13 07:01:35719
[email protected]3e2b375b2010-04-07 17:03:12720 // The kind of popup this widget represents, NONE if not a popup.
[email protected]180ef242013-11-07 06:50:46721 blink::WebPopupType popup_type_;
[email protected]0ebf3872008-11-07 21:35:03722
initial.commit09911bf2008-07-26 23:55:29723 // Holds all the needed plugin window moves for a scroll.
[email protected]29e2fb42013-07-19 01:13:47724 typedef std::vector<WebPluginGeometry> WebPluginGeometryVector;
[email protected]268654772009-08-06 23:02:04725 WebPluginGeometryVector plugin_window_moves_;
initial.commit09911bf2008-07-26 23:55:29726
[email protected]80ad8622012-11-07 16:33:03727 // While we are waiting for the browser to update window sizes, we track the
728 // pending size temporarily.
[email protected]2533ce12009-05-09 00:02:24729 int pending_window_rect_count_;
[email protected]180ef242013-11-07 06:50:46730 blink::WebRect pending_window_rect_;
[email protected]2533ce12009-05-09 00:02:24731
[email protected]80ad8622012-11-07 16:33:03732 // The screen rects of the view and the window that contains it.
733 gfx::Rect view_screen_rect_;
734 gfx::Rect window_screen_rect_;
735
[email protected]12fbad812009-09-01 18:21:24736 scoped_ptr<IPC::Message> pending_input_event_ack_;
737
[email protected]fd847792013-10-24 17:12:35738 // The time spent in input handlers this frame. Used to throttle input acks.
739 base::TimeDelta total_input_handling_time_this_frame_;
740
[email protected]b68a0e52011-12-08 15:11:12741 // Indicates if the next sequence of Char events should be suppressed or not.
742 bool suppress_next_char_events_;
743
[email protected]842f10652012-06-06 01:54:04744 // Properties of the screen hosting this RenderWidget instance.
[email protected]180ef242013-11-07 06:50:46745 blink::WebScreenInfo screen_info_;
[email protected]842f10652012-06-06 01:54:04746
[email protected]f1cccb32012-06-06 18:29:59747 // The device scale factor. This value is computed from the DPI entries in
748 // |screen_info_| on some platforms, and defaults to 1 on other platforms.
[email protected]faec7b12012-06-19 14:42:13749 float device_scale_factor_;
[email protected]f1cccb32012-06-06 18:29:59750
[email protected]28ed6b32014-06-08 02:16:27751 // The device color profile on supported platforms.
752 std::vector<char> device_color_profile_;
753
[email protected]9017d7852013-11-21 17:47:35754 // State associated with synthetic gestures. Synthetic gestures are processed
755 // in-order, so a queue is sufficient to identify the correct state for a
756 // completed gesture.
757 std::queue<SyntheticGestureCompletionCallback>
758 pending_synthetic_gesture_callbacks_;
[email protected]0e241b4b2012-08-18 09:06:27759
[email protected]8062ab262014-05-27 16:56:43760 const ui::LatencyInfo* current_event_latency_info_;
761
[email protected]53b4cc12013-07-18 23:02:30762 uint32 next_output_surface_id_;
763
[email protected]0d1ebed12013-08-05 22:01:13764#if defined(OS_ANDROID)
[email protected]90f24152014-04-09 12:41:36765 // Indicates value in the focused text field is in dirty state, i.e. modified
766 // by script etc., not by user input.
767 bool text_field_is_dirty_;
768
[email protected]0d1ebed12013-08-05 22:01:13769 // A counter for number of outstanding messages from the renderer to the
770 // browser regarding IME-type events that have not been acknowledged by the
771 // browser. If this value is not 0 IME events will be dropped.
772 int outstanding_ime_acks_;
[email protected]a4f0d882014-05-01 23:48:10773
774 // The background color of the document body element. This is used as the
775 // default background color for filling the screen areas for which we don't
776 // have the actual content.
777 SkColor body_background_color_;
[email protected]0d1ebed12013-08-05 22:01:13778#endif
779
[email protected]b2e4c70132013-10-03 02:07:51780 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_;
781
782 // Popups may be displaced when screen metrics emulation is enabled.
783 // These values are used to properly adjust popup position.
dgozman9260b0a12015-03-16 13:45:20784 gfx::PointF popup_view_origin_for_emulation_;
785 gfx::PointF popup_screen_origin_for_emulation_;
[email protected]b2e4c70132013-10-03 02:07:51786 float popup_origin_scale_for_emulation_;
787
[email protected]586871b2014-07-22 17:05:11788 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
[email protected]5b45ad42013-10-25 00:42:04789 scoped_ptr<ResizingModeSelector> resizing_mode_selector_;
790
[email protected]e3244ed2014-06-20 20:04:27791 // Lists of RenderFrameProxy objects that need to be notified of
792 // compositing-related events (e.g. DidCommitCompositorFrame).
793 ObserverList<RenderFrameProxy> render_frame_proxies_;
[email protected]a017938b2014-05-27 21:17:17794#if defined(VIDEO_HOLE)
795 ObserverList<RenderFrameImpl> video_hole_frames_;
796#endif // defined(VIDEO_HOLE)
[email protected]bffc8302014-01-23 20:52:16797
[email protected]de3c5d82014-05-28 22:12:59798 // A list of RenderFrames associated with this RenderWidget. Notifications
799 // are sent to each frame in the list for events such as changing
800 // visibility state for example.
801 ObserverList<RenderFrameImpl> render_frames_;
802
[email protected]a09d53ce2014-01-31 00:46:42803 ui::MenuSourceType context_menu_source_type_;
[email protected]be1af0662014-07-29 19:55:51804 bool has_host_context_menu_location_;
805 gfx::Point host_context_menu_location_;
[email protected]a09d53ce2014-01-31 00:46:42806
[email protected]05d478752009-04-08 23:38:16807 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
initial.commit09911bf2008-07-26 23:55:29808};
809
[email protected]e9ff79c2012-10-19 21:31:26810} // namespace content
811
[email protected]2cff0052011-03-18 16:51:44812#endif // CONTENT_RENDERER_RENDER_WIDGET_H_