blob: 66bef096f6121ef06de0ee9dd8a34b234fd5b4cb [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
avi1023d012015-12-25 02:39:148#include <stddef.h>
9#include <stdint.h>
10
[email protected]aa4117f2011-12-09 22:19:2111#include <deque>
[email protected]0e241b4b2012-08-18 09:06:2712#include <map>
[email protected]010ea08a2009-10-11 20:21:3213
[email protected]586871b2014-07-22 17:05:1114#include "base/callback.h"
[email protected]f3112a52011-09-30 23:47:4915#include "base/compiler_specific.h"
avi1023d012015-12-25 02:39:1416#include "base/macros.h"
[email protected]3b63f8f42011-03-28 01:54:1517#include "base/memory/ref_counted.h"
[email protected]8704f89b2011-04-15 00:30:0518#include "base/memory/scoped_ptr.h"
[email protected]bffc8302014-01-23 20:52:1619#include "base/observer_list.h"
[email protected]abb522162013-06-28 01:54:1620#include "base/time/time.h"
avi1023d012015-12-25 02:39:1421#include "build/build_config.h"
[email protected]f3112a52011-09-30 23:47:4922#include "content/common/content_export.h"
[email protected]c2809346d2014-03-20 00:11:0323#include "content/common/cursors/webcursor.h"
[email protected]ed7defa2013-03-12 21:29:5924#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
[email protected]9017d7852013-11-21 17:47:3525#include "content/common/input/synthetic_gesture_params.h"
mfomitchev2600fd7c2016-02-17 20:53:3926#include "content/renderer/devtools/render_widget_screen_metrics_emulator_delegate.h"
fsamuel78f86e42016-01-20 04:10:2327#include "content/renderer/gpu/render_widget_compositor_delegate.h"
fsamuel72464894f2015-12-15 06:59:3128#include "content/renderer/input/render_widget_input_handler.h"
29#include "content/renderer/input/render_widget_input_handler_delegate.h"
[email protected]586871b2014-07-22 17:05:1130#include "content/renderer/message_delivery_policy.h"
[email protected]4f86bdb2012-11-10 19:11:1931#include "ipc/ipc_listener.h"
32#include "ipc/ipc_sender.h"
mikhail.pozdnyakovc0e251b2015-04-15 06:51:1233#include "third_party/WebKit/public/platform/WebDisplayMode.h"
[email protected]5c30b5e02013-05-30 03:46:0834#include "third_party/WebKit/public/platform/WebRect.h"
[email protected]2255a9332013-06-17 05:12:3135#include "third_party/WebKit/public/web/WebCompositionUnderline.h"
[email protected]c27dd4f2014-05-22 18:05:1936#include "third_party/WebKit/public/web/WebInputEvent.h"
[email protected]2255a9332013-06-17 05:12:3137#include "third_party/WebKit/public/web/WebPopupType.h"
38#include "third_party/WebKit/public/web/WebTextDirection.h"
39#include "third_party/WebKit/public/web/WebTextInputInfo.h"
[email protected]5d0bbdfa92013-12-10 00:35:5140#include "third_party/WebKit/public/web/WebTouchAction.h"
[email protected]0e45bd02013-07-12 20:20:0241#include "third_party/WebKit/public/web/WebWidget.h"
[email protected]2255a9332013-06-17 05:12:3142#include "third_party/WebKit/public/web/WebWidgetClient.h"
[email protected]d65adb12010-04-28 17:26:4943#include "third_party/skia/include/core/SkBitmap.h"
[email protected]b256eca2013-07-11 10:57:4044#include "ui/base/ime/text_input_mode.h"
[email protected]ad26ef42011-06-17 07:59:4545#include "ui/base/ime/text_input_type.h"
[email protected]a09d53ce2014-01-31 00:46:4246#include "ui/base/ui_base_types.h"
tfarina93bfa912014-12-05 14:23:1547#include "ui/gfx/geometry/rect.h"
48#include "ui/gfx/geometry/vector2d.h"
49#include "ui/gfx/geometry/vector2d_f.h"
[email protected]08397d52011-02-05 01:53:3850#include "ui/gfx/native_widget_types.h"
[email protected]db4fc1e2013-09-06 20:01:5151#include "ui/gfx/range/range.h"
[email protected]d353541f2012-05-03 22:45:4152#include "ui/surface/transport_dib.h"
initial.commit09911bf2008-07-26 23:55:2953
[email protected]484955942010-08-19 16:13:1854namespace IPC {
55class SyncMessage;
[email protected]586871b2014-07-22 17:05:1156class SyncMessageFilter;
[email protected]484955942010-08-19 16:13:1857}
58
[email protected]180ef242013-11-07 06:50:4659namespace blink {
[email protected]19193682014-04-03 15:01:4360struct WebDeviceEmulationParams;
lfgcaab5142016-02-26 19:06:5261class WebFrameWidget;
[email protected]41d86852012-11-07 12:23:2462class WebGestureEvent;
kenrba7199832015-01-22 23:44:5963class WebLocalFrame;
[email protected]6a8ddba52010-09-05 04:38:0664class WebMouseEvent;
donnda070f3c2015-01-16 19:54:1165class WebNode;
66struct WebPoint;
[email protected]526476902011-10-06 20:34:0667}
68
[email protected]586871b2014-07-22 17:05:1169namespace cc {
70class 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
alexclarke7fa93942015-10-21 15:37:1178namespace scheduler {
79class RenderWidgetSchedulingState;
80}
81
[email protected]e9ff79c2012-10-19 21:31:2682namespace content {
danakj6e3bf8012014-12-16 18:27:5383class CompositorDependencies;
[email protected]b2e4c70132013-10-03 02:07:5184class ExternalPopupMenu;
[email protected]586871b2014-07-22 17:05:1185class FrameSwapMessageQueue;
changwanf2a707b2015-10-30 08:22:1686class ImeEventGuard;
[email protected]bffc8302014-01-23 20:52:1687class RenderFrameImpl;
[email protected]e3244ed2014-06-20 20:04:2788class RenderFrameProxy;
[email protected]ba91a792013-02-06 09:48:2889class RenderWidgetCompositor;
mfomitchev2600fd7c2016-02-17 20:53:3990class RenderWidgetScreenMetricsEmulator;
[email protected]5b45ad42013-10-25 00:42:0491class ResizingModeSelector;
[email protected]b2e4c70132013-10-03 02:07:5192struct ContextMenuParams;
jddukec05612b2015-06-25 23:13:1893struct DidOverscrollParams;
fsamuel664e8b62016-01-20 19:54:0194struct ResizeParams;
[email protected]29e2fb42013-07-19 01:13:4795struct WebPluginGeometry;
[email protected]e9ff79c2012-10-19 21:31:2696
initial.commit09911bf2008-07-26 23:55:2997// RenderWidget provides a communication bridge between a WebWidget and
98// a RenderWidgetHost, the latter of which lives in a different process.
dchengd96a27a2015-07-24 20:17:3299//
100// RenderWidget is used to implement:
101// - RenderViewImpl (deprecated)
102// - Fullscreen mode (RenderWidgetFullScreen)
103// - Popup "menus" (like the color chooser and date picker)
104// - Widgets for frames (for out-of-process iframe support)
[email protected]f3112a52011-09-30 23:47:49105class CONTENT_EXPORT RenderWidget
[email protected]c47317e2012-06-20 22:35:31106 : public IPC::Listener,
107 public IPC::Sender,
[email protected]180ef242013-11-07 06:50:46108 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient),
fsamuel78f86e42016-01-20 04:10:23109 public RenderWidgetCompositorDelegate,
fsamuel72464894f2015-12-15 06:59:31110 public RenderWidgetInputHandlerDelegate,
mfomitchev2600fd7c2016-02-17 20:53:39111 public RenderWidgetScreenMetricsEmulatorDelegate,
[email protected]f3112a52011-09-30 23:47:49112 public base::RefCounted<RenderWidget> {
initial.commit09911bf2008-07-26 23:55:29113 public:
114 // Creates a new RenderWidget. The opener_id is the routing ID of the
[email protected]380244092011-10-07 17:26:27115 // RenderView that this widget lives inside.
avi1023d012015-12-25 02:39:14116 static RenderWidget* Create(int32_t opener_id,
danakj6e3bf8012014-12-16 18:27:53117 CompositorDependencies* compositor_deps,
[email protected]180ef242013-11-07 06:50:46118 blink::WebPopupType popup_type,
119 const blink::WebScreenInfo& screen_info);
initial.commit09911bf2008-07-26 23:55:29120
kenrba7199832015-01-22 23:44:59121 // Creates a new RenderWidget that will be attached to a RenderFrame.
122 static RenderWidget* CreateForFrame(int routing_id,
kenrba7199832015-01-22 23:44:59123 bool hidden,
124 const blink::WebScreenInfo& screen_info,
125 CompositorDependencies* compositor_deps,
126 blink::WebLocalFrame* frame);
127
dchengda9b4bb2015-07-20 20:58:08128 // Closes a RenderWidget that was created by |CreateForFrame|.
dcheng3ce04b62015-10-26 23:30:55129 // TODO(avi): De-virtualize this once RenderViewImpl has-a RenderWidget.
130 // https://crbug.com/545684
131 virtual void CloseForFrame();
[email protected]484955942010-08-19 16:13:18132
avi1023d012015-12-25 02:39:14133 int32_t routing_id() const { return routing_id_; }
fsamuele8326c742016-01-12 00:49:39134 void SetRoutingID(int32_t routing_id);
135
danakj6e3bf8012014-12-16 18:27:53136 CompositorDependencies* compositor_deps() const { return compositor_deps_; }
[email protected]180ef242013-11-07 06:50:46137 blink::WebWidget* webwidget() const { return webwidget_; }
mfomitchev2600fd7c2016-02-17 20:53:39138 const gfx::Size& size() const { return size_; }
mikhail.pozdnyakovf2c902a2015-04-14 08:09:12139 bool is_fullscreen_granted() const { return is_fullscreen_granted_; }
mikhail.pozdnyakovc0e251b2015-04-15 06:51:12140 blink::WebDisplayMode display_mode() const { return display_mode_; }
[email protected]204f1df2012-01-04 20:21:13141 bool is_hidden() const { return is_hidden_; }
[email protected]4ee64622014-03-21 22:34:15142 // Temporary for debugging purposes...
143 bool closing() const { return closing_; }
144 bool is_swapped_out() { return is_swapped_out_; }
[email protected]be1af0662014-07-29 19:55:51145 bool has_host_context_menu_location() {
146 return has_host_context_menu_location_;
147 }
148 gfx::Point host_context_menu_location() {
149 return host_context_menu_location_;
[email protected]4ee64622014-03-21 22:34:15150 }
[email protected]589621b2010-09-23 22:01:07151
kenrba7199832015-01-22 23:44:59152 // ScreenInfo exposed so it can be passed to subframe RenderWidgets.
153 blink::WebScreenInfo screen_info() const { return screen_info_; }
154
[email protected]bffc8302014-01-23 20:52:16155 // Functions to track out-of-process frames for special notifications.
[email protected]e3244ed2014-06-20 20:04:27156 void RegisterRenderFrameProxy(RenderFrameProxy* proxy);
157 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy);
[email protected]bffc8302014-01-23 20:52:16158
[email protected]de3c5d82014-05-28 22:12:59159 // Functions to track all RenderFrame objects associated with this
160 // RenderWidget.
161 void RegisterRenderFrame(RenderFrameImpl* frame);
162 void UnregisterRenderFrame(RenderFrameImpl* frame);
163
[email protected]a017938b2014-05-27 21:17:17164#if defined(VIDEO_HOLE)
165 void RegisterVideoHoleFrame(RenderFrameImpl* frame);
166 void UnregisterVideoHoleFrame(RenderFrameImpl* frame);
167#endif // defined(VIDEO_HOLE)
168
[email protected]c47317e2012-06-20 22:35:31169 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52170 bool OnMessageReceived(const IPC::Message& msg) override;
initial.commit09911bf2008-07-26 23:55:29171
[email protected]c47317e2012-06-20 22:35:31172 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52173 bool Send(IPC::Message* msg) override;
initial.commit09911bf2008-07-26 23:55:29174
fsamuel78f86e42016-01-20 04:10:23175 // RenderWidgetCompositorDelegate
176 void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta,
177 const gfx::Vector2dF& outer_delta,
178 const gfx::Vector2dF& elastic_overscroll_delta,
179 float page_scale,
180 float top_controls_delta) override;
181 void BeginMainFrame(double frame_time_sec) override;
182 scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) override;
183 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource() override;
184 void DidCommitAndDrawCompositorFrame() override;
185 void DidCommitCompositorFrame() override;
186 void DidCompletePageScaleAnimation() override;
187 void DidCompleteSwapBuffers() override;
188 bool ForOOPIF() const override;
189 void ForwardCompositorProto(const std::vector<uint8_t>& proto) override;
190 bool IsClosing() const override;
191 void OnSwapBuffersAborted() override;
192 void OnSwapBuffersComplete() override;
193 void OnSwapBuffersPosted() override;
194 void RecordFrameTimingEvents(
195 scoped_ptr<cc::FrameTimingTracker::CompositeTimingSet> composite_events,
196 scoped_ptr<cc::FrameTimingTracker::MainFrameTimingSet> main_frame_events)
197 override;
danakj53eccbc2016-03-02 22:51:07198 void RequestScheduleAnimation() override;
fsamuel78f86e42016-01-20 04:10:23199 void UpdateVisualState() override;
200 void WillBeginCompositorFrame() override;
201
fsamuel72464894f2015-12-15 06:59:31202 // RenderWidgetInputHandlerDelegate
203 void FocusChangeComplete() override;
204 bool HasTouchEventHandlersAt(const gfx::Point& point) const override;
205 void ObserveWheelEventAndResult(const blink::WebMouseWheelEvent& wheel_event,
206 const gfx::Vector2dF& wheel_unused_delta,
207 bool event_processed) override;
208 void OnDidHandleKeyEvent() override;
209 void OnDidOverscroll(const DidOverscrollParams& params) override;
210 void OnInputEventAck(scoped_ptr<InputEventAck> input_event_ack) override;
dtapuska0bd451a2016-02-18 17:08:10211 void NonBlockingInputEventHandled(
212 blink::WebInputEvent::Type handled_type) override;
fsamuele8326c742016-01-12 00:49:39213 void SetInputHandler(RenderWidgetInputHandler* input_handler) override;
fsamuel72464894f2015-12-15 06:59:31214 void UpdateTextInputState(ShowIme show_ime,
215 ChangeSource change_source) override;
216 bool WillHandleGestureEvent(const blink::WebGestureEvent& event) override;
217 bool WillHandleMouseEvent(const blink::WebMouseEvent& event) override;
218
mfomitchev2600fd7c2016-02-17 20:53:39219 // RenderWidgetScreenMetricsDelegate
220 void Redraw() override;
221 void Resize(const ResizeParams& resize_params) override;
222 void SetScreenMetricsEmulationParameters(
223 bool enabled,
224 const blink::WebDeviceEmulationParams& params) override;
225 void SetScreenRects(const gfx::Rect& view_screen_rect,
226 const gfx::Rect& window_screen_rect) override;
227
[email protected]180ef242013-11-07 06:50:46228 // blink::WebWidgetClient
avi5c77d212015-09-25 20:08:25229 void didAutoResize(const blink::WebSize& new_size) override;
230 void initializeLayerTreeView() override;
231 blink::WebLayerTreeView* layerTreeView() override;
dglazkovf0e1d6d2015-10-10 02:13:48232 void didMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override;
avi5c77d212015-09-25 20:08:25233 void didFocus() override;
avi5c77d212015-09-25 20:08:25234 void didChangeCursor(const blink::WebCursorInfo&) override;
235 void closeWidgetSoon() override;
236 void show(blink::WebNavigationPolicy) override;
237 blink::WebRect windowRect() override;
238 void setToolTipText(const blink::WebString& text,
239 blink::WebTextDirection hint) override;
240 void setWindowRect(const blink::WebRect&) override;
241 blink::WebRect windowResizerRect() override;
242 blink::WebRect rootWindowRect() override;
243 blink::WebScreenInfo screenInfo() override;
avi5c77d212015-09-25 20:08:25244 void resetInputMethod() override;
245 void didHandleGestureEvent(const blink::WebGestureEvent& event,
246 bool event_cancelled) override;
247 void didOverscroll(const blink::WebFloatSize& unusedDelta,
248 const blink::WebFloatSize& accumulatedRootOverScroll,
249 const blink::WebFloatPoint& position,
250 const blink::WebFloatSize& velocity) override;
251 void showImeIfNeeded() override;
oshima581cf3f62015-12-16 20:08:01252 void convertViewportToWindow(blink::WebRect* rect) override;
oshimaa6985b62016-01-27 08:58:30253 void convertWindowToViewport(blink::WebFloatRect* rect) override;
[email protected]4873c7d2009-07-16 06:36:28254
fsamuel72464894f2015-12-15 06:59:31255 // Override point to obtain that the current input method state and caret
256 // position.
257 virtual ui::TextInputType GetTextInputType();
258 virtual ui::TextInputType WebKitToUiTextInputType(
259 blink::WebTextInputType type);
260
donnda070f3c2015-01-16 19:54:11261#if defined(OS_ANDROID)
262 // Notifies that a tap was not consumed, so showing a UI for the unhandled
263 // tap may be needed.
donnd57e54f52015-02-26 19:03:37264 // Performs various checks on the given WebNode to apply heuristics to
265 // determine if triggering is appropriate.
avi5c77d212015-09-25 20:08:25266 void showUnhandledTapUIIfNeeded(const blink::WebPoint& tapped_position,
267 const blink::WebNode& tapped_node,
268 bool page_changed) override;
donnda070f3c2015-01-16 19:54:11269#endif
270
[email protected]7912e822014-04-16 02:37:03271 // Begins the compositor's scheduler to start producing frames.
272 void StartCompositor();
273
[email protected]aeeedad2014-08-22 18:16:22274 // Stop compositing.
ennef3c58142014-12-09 21:44:38275 void WillCloseLayerTreeView();
[email protected]aeeedad2014-08-22 18:16:22276
[email protected]4873c7d2009-07-16 06:36:28277 // Called when a plugin is moved. These events are queued up and sent with
278 // the next paint or scroll message to the host.
[email protected]29e2fb42013-07-19 01:13:47279 void SchedulePluginMove(const WebPluginGeometry& move);
initial.commit09911bf2008-07-26 23:55:29280
[email protected]268654772009-08-06 23:02:04281 // Called when a plugin window has been destroyed, to make sure the currently
282 // pending moves don't try to reference it.
283 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window);
284
[email protected]24ed0432013-04-24 07:50:31285 RenderWidgetCompositor* compositor() const;
286
fsamuel72464894f2015-12-15 06:59:31287 const RenderWidgetInputHandler& input_handler() const {
fsamuele8326c742016-01-12 00:49:39288 return *input_handler_;
fsamuel72464894f2015-12-15 06:59:31289 }
290
291 void SetHandlingInputEventForTesting(bool handling_input_event);
292
293 // When paused in debugger, we send ack for mouse event early. This ensures
294 // that we continue receiving mouse moves and pass them to debugger. Returns
295 // whether we are paused in mouse move event and have sent the ack.
296 bool SendAckForMouseMoveFromDebugger();
297
298 // When resumed from pause in debugger while handling mouse move,
299 // we should not send an extra ack (see SendAckForMouseMoveFromDebugger).
300 void IgnoreAckForMouseMoveFromDebugger();
301
[email protected]79fa22e2013-08-23 15:18:12302 // Callback for use with synthetic gestures (e.g. BeginSmoothScroll).
303 typedef base::Callback<void()> SyntheticGestureCompletionCallback;
[email protected]0e241b4b2012-08-18 09:06:27304
[email protected]9017d7852013-11-21 17:47:35305 // Send a synthetic gesture to the browser to be queued to the synthetic
306 // gesture controller.
307 void QueueSyntheticGesture(
308 scoped_ptr<SyntheticGestureParams> gesture_params,
309 const SyntheticGestureCompletionCallback& callback);
[email protected]1e1dd182013-09-12 01:51:15310
[email protected]586871b2014-07-22 17:05:11311 // Deliveres |message| together with compositor state change updates. The
312 // exact behavior depends on |policy|.
313 // This mechanism is not a drop-in replacement for IPC: messages sent this way
314 // will not be automatically available to BrowserMessageFilter, for example.
315 // FIFO ordering is preserved between messages enqueued with the same
316 // |policy|, the ordering between messages enqueued for different policies is
317 // undefined.
318 //
319 // |msg| message to send, ownership of |msg| is transferred.
320 // |policy| see the comment on MessageDeliveryPolicy.
321 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy);
322
changwan8c342742016-02-26 00:53:39323 // Check whether IME thread is being used or not.
324 bool IsUsingImeThread();
325
changwanf2a707b2015-10-30 08:22:16326 // Handle start and finish of IME event guard.
327 void OnImeEventGuardStart(ImeEventGuard* guard);
328 void OnImeEventGuardFinish(ImeEventGuard* guard);
[email protected]66fca5bc2013-05-23 06:58:29329
[email protected]4ee64622014-03-21 22:34:15330 // Returns whether we currently should handle an IME event.
331 bool ShouldHandleImeEvent();
332
mfomitchev2600fd7c2016-02-17 20:53:39333 void SetPopupOriginAdjustmentsForEmulation(
334 RenderWidgetScreenMetricsEmulator* emulator);
[email protected]b2e4c70132013-10-03 02:07:51335
[email protected]2d6836f42014-07-02 17:25:31336 gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor);
[email protected]b2e4c70132013-10-03 02:07:51337
jdduke491a3f0c2015-06-15 23:30:26338
339 void ScheduleComposite();
[email protected]7d08a9352013-10-15 08:24:56340 void ScheduleCompositeWithForcedRedraw();
341
[email protected]7a4e2532013-12-02 21:30:02342 // Checks if the selection bounds have been changed. If they are changed,
343 // the new value will be sent to the browser process.
344 void UpdateSelectionBounds();
345
dtrainor5ef644e2015-11-19 00:12:47346 // Called by the compositor to forward a proto that represents serialized
347 // compositor state.
dtrainor5ef644e2015-11-19 00:12:47348
[email protected]e5e438d62014-03-27 21:47:16349 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end);
350
[email protected]a09d53ce2014-01-31 00:46:42351 void OnShowHostContextMenu(ContextMenuParams* params);
[email protected]7a4e2532013-12-02 21:30:02352
[email protected]7a4e2532013-12-02 21:30:02353 // Checks if the composition range or composition character bounds have been
354 // changed. If they are changed, the new value will be sent to the browser
yukawa5f21c6a2014-10-27 17:09:30355 // process. This method does nothing when the browser process is not able to
356 // handle composition range and composition character bounds.
[email protected]7a4e2532013-12-02 21:30:02357 void UpdateCompositionInfo(bool should_update_range);
[email protected]7a4e2532013-12-02 21:30:02358
initial.commit09911bf2008-07-26 23:55:29359 protected:
[email protected]8085dbc82008-09-26 22:53:44360 // Friend RefCounted so that the dtor can be non-public. Using this class
361 // without ref-counting is an error.
362 friend class base::RefCounted<RenderWidget>;
fsamuele8326c742016-01-12 00:49:39363
[email protected]7339cd22010-10-27 00:11:20364 // For unit tests.
[email protected]e9ff79c2012-10-19 21:31:26365 friend class RenderWidgetTest;
[email protected]8085dbc82008-09-26 22:53:44366
[email protected]61e2b3cc2012-03-02 16:13:34367 enum ResizeAck {
368 SEND_RESIZE_ACK,
369 NO_RESIZE_ACK,
370 };
371
dcheng35d31c112015-07-22 00:17:36372 RenderWidget(CompositorDependencies* compositor_deps,
373 blink::WebPopupType popup_type,
[email protected]180ef242013-11-07 06:50:46374 const blink::WebScreenInfo& screen_info,
[email protected]1ac10dca2013-08-20 20:47:04375 bool swapped_out,
[email protected]7912e822014-04-16 02:37:03376 bool hidden,
377 bool never_visible);
[email protected]ce2b28e2012-08-09 15:53:57378
dcheng6d18e402014-10-21 12:32:52379 ~RenderWidget() override;
initial.commit09911bf2008-07-26 23:55:29380
lfgcaab5142016-02-26 19:06:52381 static blink::WebFrameWidget* CreateWebFrameWidget(
382 RenderWidget* render_widget,
383 blink::WebLocalFrame* frame);
dchengda9b4bb2015-07-20 20:58:08384
385 // Creates a WebWidget based on the popup type.
386 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget);
387
pimanc4af3072015-10-02 03:45:59388 // Initializes this view with the given opener.
avi1023d012015-12-25 02:39:14389 bool Init(int32_t opener_id);
initial.commit09911bf2008-07-26 23:55:29390
[email protected]484955942010-08-19 16:13:18391 // Called by Init and subclasses to perform initialization.
avi1023d012015-12-25 02:39:14392 bool DoInit(int32_t opener_id,
[email protected]180ef242013-11-07 06:50:46393 blink::WebWidget* web_widget,
[email protected]484955942010-08-19 16:13:18394 IPC::SyncMessage* create_widget_message);
395
[email protected]992db4c2011-05-12 15:37:15396 // Sets whether this RenderWidget has been swapped out to be displayed by
397 // a RenderWidget in a different process. If so, no new IPC messages will be
398 // sent (only ACKs) and the process is free to exit when there are no other
399 // active RenderWidgets.
400 void SetSwappedOut(bool is_swapped_out);
401
[email protected]949b6592014-08-20 13:17:52402 // Allows the process to exit once the unload handler has finished, if there
403 // are no other active RenderWidgets.
404 void WasSwappedOut();
405
[email protected]2533ce12009-05-09 00:02:24406 void DoDeferredClose();
dgozmancf9039cd2015-04-06 12:01:31407 void NotifyOnClose();
dchengda9b4bb2015-07-20 20:58:08408
409 // Close the underlying WebWidget.
410 virtual void Close();
initial.commit09911bf2008-07-26 23:55:29411
[email protected]92650162013-10-30 03:31:02412 // Used to force the size of a window when running layout tests.
bokanc007c3a2015-02-03 07:15:56413 void SetWindowRectSynchronously(const gfx::Rect& new_window_rect);
[email protected]53907862014-03-25 15:42:40414#if defined(OS_MACOSX) || defined(OS_ANDROID)
[email protected]b2e4c70132013-10-03 02:07:51415 void SetExternalPopupOriginAdjustmentsForEmulation(
mfomitchev2600fd7c2016-02-17 20:53:39416 ExternalPopupMenu* popup,
417 RenderWidgetScreenMetricsEmulator* emulator);
[email protected]53907862014-03-25 15:42:40418#endif
[email protected]61e2b3cc2012-03-02 16:13:34419
initial.commit09911bf2008-07-26 23:55:29420 // RenderWidget IPC message handlers
[email protected]180ef242013-11-07 06:50:46421 void OnHandleInputEvent(const blink::WebInputEvent* event,
dtapuska0bd451a2016-02-18 17:08:10422 const ui::LatencyInfo& latency_info,
423 InputEventDispatchType dispatch_type);
[email protected]34202de2013-05-06 23:36:22424 void OnCursorVisibilityChange(bool is_visible);
[email protected]c084330e02013-04-27 01:08:15425 void OnMouseCaptureLost();
426 virtual void OnSetFocus(bool enable);
naskoc288745f2015-05-01 22:54:21427 void OnClose();
[email protected]fc4404d2012-11-07 19:53:30428 void OnCreatingNewAck();
fsamuel664e8b62016-01-20 19:54:01429 virtual void OnResize(const ResizeParams& params);
dgozman9260b0a12015-03-16 13:45:20430 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params);
431 void OnDisableDeviceEmulation();
noel89949e62014-09-30 01:12:41432 void OnColorProfile(const std::vector<char>& color_profile);
[email protected]b5913d72012-02-07 22:26:54433 void OnChangeResizeRect(const gfx::Rect& resizer_rect);
[email protected]941e4552010-02-01 21:23:43434 virtual void OnWasHidden();
[email protected]3399dd822014-08-09 11:14:24435 virtual void OnWasShown(bool needs_repainting,
436 const ui::LatencyInfo& latency_info);
avi1023d012015-12-25 02:39:14437 void OnCreateVideoAck(int32_t video_id);
438 void OnUpdateVideoAck(int32_t video_id);
[email protected]2533ce12009-05-09 00:02:24439 void OnRequestMoveAck();
[email protected]56ea1a62011-05-30 07:05:57440 virtual void OnImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26441 const base::string16& text,
[email protected]180ef242013-11-07 06:50:46442 const std::vector<blink::WebCompositionUnderline>& underlines,
chongz7eb752802016-01-27 21:28:07443 const gfx::Range& replacement_range,
[email protected]fa7b1dc2010-06-23 17:53:04444 int selection_start,
445 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26446 virtual void OnImeConfirmComposition(const base::string16& text,
[email protected]db4fc1e2013-09-06 20:01:51447 const gfx::Range& replacement_range,
[email protected]0e45bd02013-07-12 20:20:02448 bool keep_selection);
oshimad5279032015-12-16 18:22:33449 // Called when the device scale factor is changed, or the layer tree is
450 // initialized.
451 virtual void OnDeviceScaleFactorChanged();
452
[email protected]0bc1f572013-04-17 01:46:31453 void OnRepaint(gfx::Size size_to_paint);
[email protected]79fa22e2013-08-23 15:18:12454 void OnSyntheticGestureCompleted();
[email protected]180ef242013-11-07 06:50:46455 void OnSetTextDirection(blink::WebTextDirection direction);
[email protected]872ae5b2011-05-26 20:20:50456 void OnGetFPS();
[email protected]80ad8622012-11-07 16:33:03457 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
458 const gfx::Rect& window_screen_rect);
[email protected]2384b6c2013-02-28 23:58:51459 void OnShowImeIfNeeded();
kenrbb4e2a3b2015-05-14 15:05:05460 void OnSetSurfaceIdNamespace(uint32_t surface_id_namespace);
dtrainor5ef644e2015-11-19 00:12:47461 void OnHandleCompositorProto(const std::vector<uint8_t>& proto);
[email protected]0d1ebed12013-08-05 22:01:13462
[email protected]adb362312014-06-28 06:04:24463#if defined(OS_ANDROID)
changwan3a841162015-08-11 02:53:37464 // Called when we send IME event that expects an ACK.
465 void OnImeEventSentForAck(const blink::WebTextInputInfo& info);
[email protected]0d1ebed12013-08-05 22:01:13466
467 // Called by the browser process for every required IME acknowledgement.
468 void OnImeEventAck();
changwan8c342742016-02-26 00:53:39469
470 // Called by the browser process to update text input state.
471 void OnRequestTextInputStateUpdate();
[email protected]105dffb42013-02-20 03:46:21472#endif
[email protected]0d1ebed12013-08-05 22:01:13473
[email protected]847a2582013-03-09 02:29:51474 // Notify the compositor about a change in viewport size. This should be
475 // used only with auto resize mode WebWidgets, as normal WebWidgets should
476 // go through OnResize.
[email protected]97e1bf72013-03-06 14:06:05477 void AutoResizeCompositor();
478
[email protected]468ac582012-11-20 00:53:19479 virtual void SetDeviceScaleFactor(float device_scale_factor);
[email protected]28ed6b32014-06-08 02:16:27480 virtual bool SetDeviceColorProfile(const std::vector<char>& color_profile);
noeldb4df152014-09-16 17:45:20481 virtual void ResetDeviceColorProfileForTesting();
[email protected]468ac582012-11-20 00:53:19482
[email protected]fcdc5642014-05-09 14:32:24483 virtual void OnOrientationChange();
484
[email protected]29ed96a2012-02-04 18:12:16485 // Override points to notify derived classes that a paint has happened.
[email protected]0704ac32013-10-03 15:24:22486 // DidInitiatePaint happens when that has completed, and subsequent rendering
487 // won't affect the painted content. DidFlushPaint happens once we've received
488 // the ACK that the screen has been updated. For a given paint operation,
489 // these overrides will always be called in the order DidInitiatePaint,
490 // DidFlushPaint.
[email protected]00c39612010-03-06 02:53:28491 virtual void DidInitiatePaint() {}
492 virtual void DidFlushPaint() {}
[email protected]a2f6bc112009-06-27 16:27:25493
[email protected]ed7defa2013-03-12 21:29:59494 virtual GURL GetURLForGraphicsContext3D();
[email protected]65225772011-05-12 21:10:24495
[email protected]d54169e92011-01-21 09:19:52496 // Gets the scroll offset of this widget, if this widget has a notion of
497 // scroll offset.
[email protected]ceb36f7d2012-10-31 18:33:24498 virtual gfx::Vector2d GetScrollOffset();
[email protected]d54169e92011-01-21 09:19:52499
[email protected]bee16aab2009-08-26 15:55:03500 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
501 // use this method so that we can properly inform the RenderThread of our
502 // state.
503 void SetHidden(bool hidden);
504
[email protected]2b624c562011-10-27 22:58:26505 void DidToggleFullscreen();
506
[email protected]674741932009-02-04 23:44:46507 bool next_paint_is_resize_ack() const;
[email protected]674741932009-02-04 23:44:46508 void set_next_paint_is_resize_ack();
[email protected]674741932009-02-04 23:44:46509 void set_next_paint_is_repaint_ack();
[email protected]ec7dc112008-08-06 05:30:12510
[email protected]586871b2014-07-22 17:05:11511 // QueueMessage implementation extracted into a static method for easy
512 // testing.
513 static scoped_ptr<cc::SwapPromise> QueueMessageImpl(
514 IPC::Message* msg,
515 MessageDeliveryPolicy policy,
516 FrameSwapMessageQueue* frame_swap_message_queue,
517 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter,
[email protected]586871b2014-07-22 17:05:11518 int source_frame_number);
519
[email protected]58b48a0d2012-06-13 07:01:35520 // Override point to obtain that the current composition character bounds.
521 // In the case of surrogate pairs, the character is treated as two characters:
522 // the bounds for first character is actual one, and the bounds for second
523 // character is zero width rectangle.
524 virtual void GetCompositionCharacterBounds(
525 std::vector<gfx::Rect>* character_bounds);
526
[email protected]88dbe32f2013-06-20 23:31:36527 // Returns the range of the text that is being composed or the selection if
528 // the composition does not exist.
[email protected]db4fc1e2013-09-06 20:01:51529 virtual void GetCompositionRange(gfx::Range* range);
[email protected]88dbe32f2013-06-20 23:31:36530
[email protected]58b48a0d2012-06-13 07:01:35531 // Returns true if the composition range or composition character bounds
532 // should be sent to the browser process.
533 bool ShouldUpdateCompositionInfo(
[email protected]db4fc1e2013-09-06 20:01:51534 const gfx::Range& range,
[email protected]58b48a0d2012-06-13 07:01:35535 const std::vector<gfx::Rect>& bounds);
536
[email protected]ad26ef42011-06-17 07:59:45537 // Override point to obtain that the current input method state about
538 // composition text.
539 virtual bool CanComposeInline();
[email protected]56ea1a62011-05-30 07:05:57540
[email protected]2533ce12009-05-09 00:02:24541 // Set the pending window rect.
542 // Because the real render_widget is hosted in another process, there is
543 // a time period where we may have set a new window rect which has not yet
544 // been processed by the browser. So we maintain a pending window rect
545 // size. If JS code sets the WindowRect, and then immediately calls
546 // GetWindowRect() we'll use this pending window rect as the size.
[email protected]180ef242013-11-07 06:50:46547 void SetPendingWindowRect(const blink::WebRect& r);
[email protected]2533ce12009-05-09 00:02:24548
[email protected]ce6689f2013-03-29 12:52:55549 // Check whether the WebWidget has any touch event handlers registered.
avi5c77d212015-09-25 20:08:25550 void hasTouchEventHandlers(bool has_handlers) override;
[email protected]ce6689f2013-03-29 12:52:55551
[email protected]5d0bbdfa92013-12-10 00:35:51552 // Tell the browser about the actions permitted for a new touch point.
avi5c77d212015-09-25 20:08:25553 void setTouchAction(blink::WebTouchAction touch_action) override;
[email protected]5d0bbdfa92013-12-10 00:35:51554
[email protected]90f24152014-04-09 12:41:36555 // Called when value of focused text field gets dirty, e.g. value is modified
556 // by script, not by user input.
avi5c77d212015-09-25 20:08:25557 void didUpdateTextOfFocusedElementByNonUserInput() override;
[email protected]90f24152014-04-09 12:41:36558
[email protected]ed7defa2013-03-12 21:29:59559 // Creates a 3D context associated with this view.
jbauman5e420d32015-08-05 09:33:01560 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D(
piman990d8ea2016-01-12 15:35:31561 GpuChannelHost* gpu_channel_host);
[email protected]ed7defa2013-03-12 21:29:59562
lfg43e08e62016-02-03 18:51:37563 // Sends an ACK to the browser process during the next compositor frame.
564 void OnWaitNextFrameForTests(int routing_id);
565
initial.commit09911bf2008-07-26 23:55:29566 // Routing ID that allows us to communicate to the parent browser process
567 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
avi1023d012015-12-25 02:39:14568 int32_t routing_id_;
initial.commit09911bf2008-07-26 23:55:29569
danakj6e3bf8012014-12-16 18:27:53570 // Dependencies for initializing a compositor, including flags for optional
571 // features.
dcheng35d31c112015-07-22 00:17:36572 CompositorDependencies* const compositor_deps_;
danakj6e3bf8012014-12-16 18:27:53573
[email protected]c5b3b5e2009-02-13 06:41:11574 // We are responsible for destroying this object via its Close method.
[email protected]4ee64622014-03-21 22:34:15575 // May be NULL when the window is closing.
[email protected]180ef242013-11-07 06:50:46576 blink::WebWidget* webwidget_;
initial.commit09911bf2008-07-26 23:55:29577
[email protected]8926c602013-01-23 05:32:06578 // This is lazily constructed and must not outlive webwidget_.
[email protected]ba91a792013-02-06 09:48:28579 scoped_ptr<RenderWidgetCompositor> compositor_;
[email protected]8926c602013-01-23 05:32:06580
initial.commit09911bf2008-07-26 23:55:29581 // Set to the ID of the view that initiated creating this view, if any. When
582 // the view was initiated by the browser (the common case), this will be
583 // MSG_ROUTING_NONE. This is used in determining ownership when opening
584 // child tabs. See RenderWidget::createWebViewWithRequest.
585 //
586 // This ID may refer to an invalid view if that view is closed before this
587 // view is.
avi1023d012015-12-25 02:39:14588 int32_t opener_id_;
initial.commit09911bf2008-07-26 23:55:29589
bokanc007c3a2015-02-03 07:15:56590 // The rect where this view should be initially shown.
591 gfx::Rect initial_rect_;
initial.commit09911bf2008-07-26 23:55:29592
initial.commit09911bf2008-07-26 23:55:29593 // We store the current cursor object so we can avoid spamming SetCursor
594 // messages.
595 WebCursor current_cursor_;
[email protected]88efb7ec2009-07-14 16:32:59596
initial.commit09911bf2008-07-26 23:55:29597 // The size of the RenderWidget.
598 gfx::Size size_;
599
[email protected]60d47ac2013-03-01 23:42:44600 // The size of the view's backing surface in non-DPI-adjusted pixels.
601 gfx::Size physical_backing_size_;
602
dtrainorcb7779b82014-12-04 01:08:02603 // Whether or not Blink's viewport size should be shrunk by the height of the
604 // URL-bar (always false on platforms where URL-bar hiding isn't supported).
605 bool top_controls_shrink_blink_size_;
606
607 // The height of the top controls (always 0 on platforms where URL-bar hiding
608 // isn't supported).
609 float top_controls_height_;
[email protected]d9083762013-03-24 01:36:40610
[email protected]bb6378fe2014-04-28 21:19:44611 // The size of the visible viewport in DPI-adjusted pixels.
612 gfx::Size visible_viewport_size_;
613
[email protected]f21c613a2009-02-12 14:46:17614 // The area that must be reserved for drawing the resize corner.
615 gfx::Rect resizer_rect_;
616
[email protected]53d3f302009-12-21 04:42:05617 // Flags for the next ViewHostMsg_UpdateRect message.
initial.commit09911bf2008-07-26 23:55:29618 int next_paint_flags_;
619
[email protected]847a2582013-03-09 02:29:51620 // Whether the WebWidget is in auto resize mode, which is used for example
621 // by extension popups.
622 bool auto_resize_mode_;
623
[email protected]ea3ee0a2012-05-15 03:43:09624 // True if we need to send an UpdateRect message to notify the browser about
625 // an already-completed auto-resize.
626 bool need_update_rect_for_auto_resize_;
627
initial.commit09911bf2008-07-26 23:55:29628 // Set to true if we should ignore RenderWidget::Show calls.
629 bool did_show_;
630
631 // Indicates that we shouldn't bother generated paint events.
632 bool is_hidden_;
633
[email protected]7912e822014-04-16 02:37:03634 // Indicates that we are never visible, so never produce graphical output.
sievers71c62dd52015-10-07 01:44:39635 const bool compositor_never_visible_;
[email protected]7912e822014-04-16 02:37:03636
mikhail.pozdnyakovf2c902a2015-04-14 08:09:12637 // Indicates whether tab-initiated fullscreen was granted.
638 bool is_fullscreen_granted_;
[email protected]ee41e7d22011-10-14 19:34:09639
mikhail.pozdnyakovc0e251b2015-04-15 06:51:12640 // Indicates the display mode.
641 blink::WebDisplayMode display_mode_;
642
changwanf2a707b2015-10-30 08:22:16643 // It is possible that one ImeEventGuard is nested inside another
644 // ImeEventGuard. We keep track of the outermost one, and update it as needed.
645 ImeEventGuard* ime_event_guard_;
[email protected]e8f775f2013-02-14 21:00:50646
initial.commit09911bf2008-07-26 23:55:29647 // True if we have requested this widget be closed. No more messages will
648 // be sent, except for a Close.
649 bool closing_;
650
[email protected]aeeedad2014-08-22 18:16:22651 // True if it is known that the host is in the process of being shut down.
652 bool host_closing_;
653
[email protected]992db4c2011-05-12 15:37:15654 // Whether this RenderWidget is currently swapped out, such that the view is
655 // being rendered by another process. If all RenderWidgets in a process are
656 // swapped out, the process can exit.
657 bool is_swapped_out_;
658
simonhong628f9812015-04-27 23:13:20659 // TODO(simonhong): Remove this when we enable BeginFrame scheduling for
660 // OOPIF(crbug.com/471411).
661 // Whether this RenderWidget is for an out-of-process iframe or not.
662 bool for_oopif_;
663
[email protected]5b739cb2012-08-21 20:35:21664 // Stores information about the current text input.
[email protected]180ef242013-11-07 06:50:46665 blink::WebTextInputInfo text_input_info_;
[email protected]5b739cb2012-08-21 20:35:21666
[email protected]fa7b1dc2010-06-23 17:53:04667 // Stores the current text input type of |webwidget_|.
[email protected]ad26ef42011-06-17 07:59:45668 ui::TextInputType text_input_type_;
669
[email protected]b256eca2013-07-11 10:57:40670 // Stores the current text input mode of |webwidget_|.
671 ui::TextInputMode text_input_mode_;
672
shuchen82ce8c52014-10-23 01:55:20673 // Stores the current text input flags of |webwidget_|.
674 int text_input_flags_;
675
[email protected]86ba5fcb2013-09-04 00:36:53676 // Stores the current type of composition text rendering of |webwidget_|.
677 bool can_compose_inline_;
678
[email protected]e99ef6f2011-10-16 01:13:00679 // Stores the current selection bounds.
[email protected]7c8873e2013-02-05 08:03:01680 gfx::Rect selection_focus_rect_;
681 gfx::Rect selection_anchor_rect_;
initial.commit09911bf2008-07-26 23:55:29682
[email protected]58b48a0d2012-06-13 07:01:35683 // Stores the current composition character bounds.
684 std::vector<gfx::Rect> composition_character_bounds_;
685
686 // Stores the current composition range.
[email protected]db4fc1e2013-09-06 20:01:51687 gfx::Range composition_range_;
[email protected]58b48a0d2012-06-13 07:01:35688
[email protected]3e2b375b2010-04-07 17:03:12689 // The kind of popup this widget represents, NONE if not a popup.
[email protected]180ef242013-11-07 06:50:46690 blink::WebPopupType popup_type_;
[email protected]0ebf3872008-11-07 21:35:03691
initial.commit09911bf2008-07-26 23:55:29692 // Holds all the needed plugin window moves for a scroll.
[email protected]29e2fb42013-07-19 01:13:47693 typedef std::vector<WebPluginGeometry> WebPluginGeometryVector;
[email protected]268654772009-08-06 23:02:04694 WebPluginGeometryVector plugin_window_moves_;
initial.commit09911bf2008-07-26 23:55:29695
[email protected]80ad8622012-11-07 16:33:03696 // While we are waiting for the browser to update window sizes, we track the
697 // pending size temporarily.
[email protected]2533ce12009-05-09 00:02:24698 int pending_window_rect_count_;
[email protected]180ef242013-11-07 06:50:46699 blink::WebRect pending_window_rect_;
[email protected]2533ce12009-05-09 00:02:24700
[email protected]80ad8622012-11-07 16:33:03701 // The screen rects of the view and the window that contains it.
702 gfx::Rect view_screen_rect_;
703 gfx::Rect window_screen_rect_;
704
fsamuele8326c742016-01-12 00:49:39705 scoped_ptr<RenderWidgetInputHandler> input_handler_;
[email protected]12fbad812009-09-01 18:21:24706
[email protected]fd847792013-10-24 17:12:35707 // The time spent in input handlers this frame. Used to throttle input acks.
708 base::TimeDelta total_input_handling_time_this_frame_;
709
[email protected]842f10652012-06-06 01:54:04710 // Properties of the screen hosting this RenderWidget instance.
[email protected]180ef242013-11-07 06:50:46711 blink::WebScreenInfo screen_info_;
[email protected]842f10652012-06-06 01:54:04712
[email protected]f1cccb32012-06-06 18:29:59713 // The device scale factor. This value is computed from the DPI entries in
714 // |screen_info_| on some platforms, and defaults to 1 on other platforms.
[email protected]faec7b12012-06-19 14:42:13715 float device_scale_factor_;
[email protected]f1cccb32012-06-06 18:29:59716
[email protected]28ed6b32014-06-08 02:16:27717 // The device color profile on supported platforms.
718 std::vector<char> device_color_profile_;
719
[email protected]9017d7852013-11-21 17:47:35720 // State associated with synthetic gestures. Synthetic gestures are processed
721 // in-order, so a queue is sufficient to identify the correct state for a
722 // completed gesture.
723 std::queue<SyntheticGestureCompletionCallback>
724 pending_synthetic_gesture_callbacks_;
[email protected]0e241b4b2012-08-18 09:06:27725
avi1023d012015-12-25 02:39:14726 uint32_t next_output_surface_id_;
[email protected]53b4cc12013-07-18 23:02:30727
[email protected]0d1ebed12013-08-05 22:01:13728#if defined(OS_ANDROID)
[email protected]90f24152014-04-09 12:41:36729 // Indicates value in the focused text field is in dirty state, i.e. modified
730 // by script etc., not by user input.
731 bool text_field_is_dirty_;
732
changwan3a841162015-08-11 02:53:37733 // Stores the history of text input infos from the last ACK'ed one from the
734 // current one. The size is the number of pending ACKs plus one, since we
735 // intentionally keep the last ack'd value to know what the browser is
736 // currently aware of.
737 std::deque<blink::WebTextInputInfo> text_input_info_history_;
[email protected]0d1ebed12013-08-05 22:01:13738#endif
739
mfomitchev2600fd7c2016-02-17 20:53:39740 scoped_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_;
[email protected]b2e4c70132013-10-03 02:07:51741
742 // Popups may be displaced when screen metrics emulation is enabled.
743 // These values are used to properly adjust popup position.
danakj2ef31b82015-10-21 18:18:02744 gfx::Point popup_view_origin_for_emulation_;
745 gfx::Point popup_screen_origin_for_emulation_;
[email protected]b2e4c70132013-10-03 02:07:51746 float popup_origin_scale_for_emulation_;
747
[email protected]586871b2014-07-22 17:05:11748 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
[email protected]5b45ad42013-10-25 00:42:04749 scoped_ptr<ResizingModeSelector> resizing_mode_selector_;
750
[email protected]e3244ed2014-06-20 20:04:27751 // Lists of RenderFrameProxy objects that need to be notified of
752 // compositing-related events (e.g. DidCommitCompositorFrame).
brettw236d3172015-06-03 16:31:43753 base::ObserverList<RenderFrameProxy> render_frame_proxies_;
[email protected]a017938b2014-05-27 21:17:17754#if defined(VIDEO_HOLE)
brettw236d3172015-06-03 16:31:43755 base::ObserverList<RenderFrameImpl> video_hole_frames_;
[email protected]a017938b2014-05-27 21:17:17756#endif // defined(VIDEO_HOLE)
[email protected]bffc8302014-01-23 20:52:16757
[email protected]de3c5d82014-05-28 22:12:59758 // A list of RenderFrames associated with this RenderWidget. Notifications
759 // are sent to each frame in the list for events such as changing
760 // visibility state for example.
brettw236d3172015-06-03 16:31:43761 base::ObserverList<RenderFrameImpl> render_frames_;
[email protected]de3c5d82014-05-28 22:12:59762
[email protected]be1af0662014-07-29 19:55:51763 bool has_host_context_menu_location_;
764 gfx::Point host_context_menu_location_;
[email protected]a09d53ce2014-01-31 00:46:42765
alexclarke7fa93942015-10-21 15:37:11766 scoped_ptr<scheduler::RenderWidgetSchedulingState>
767 render_widget_scheduling_state_;
768
[email protected]05d478752009-04-08 23:38:16769 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
initial.commit09911bf2008-07-26 23:55:29770};
771
[email protected]e9ff79c2012-10-19 21:31:26772} // namespace content
773
[email protected]2cff0052011-03-18 16:51:44774#endif // CONTENT_RENDERER_RENDER_WIDGET_H_