blob: 68e0432849d25fae2b95cb92c530aa399a2c93ae [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
initial.commit09911bf2008-07-26 23:55:2911#include "base/basictypes.h"
[email protected]586871b2014-07-22 17:05:1112#include "base/callback.h"
[email protected]f3112a52011-09-30 23:47:4913#include "base/compiler_specific.h"
[email protected]3b63f8f42011-03-28 01:54:1514#include "base/memory/ref_counted.h"
[email protected]8704f89b2011-04-15 00:30:0515#include "base/memory/scoped_ptr.h"
[email protected]bffc8302014-01-23 20:52:1616#include "base/observer_list.h"
[email protected]abb522162013-06-28 01:54:1617#include "base/time/time.h"
[email protected]f3112a52011-09-30 23:47:4918#include "content/common/content_export.h"
[email protected]c2809346d2014-03-20 00:11:0319#include "content/common/cursors/webcursor.h"
[email protected]ed7defa2013-03-12 21:29:5920#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
[email protected]9017d7852013-11-21 17:47:3521#include "content/common/input/synthetic_gesture_params.h"
[email protected]586871b2014-07-22 17:05:1122#include "content/renderer/message_delivery_policy.h"
[email protected]4f86bdb82012-11-10 19:11:1923#include "ipc/ipc_listener.h"
24#include "ipc/ipc_sender.h"
mikhail.pozdnyakovc0e251b2015-04-15 06:51:1225#include "third_party/WebKit/public/platform/WebDisplayMode.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]db4fc1e22013-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]db4fc1e22013-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;
jddukec05612b2015-06-25 23:13:1889struct DidOverscrollParams;
[email protected]29e2fb42013-07-19 01:13:4790struct WebPluginGeometry;
[email protected]e9ff79c2012-10-19 21:31:2691
initial.commit09911bf2008-07-26 23:55:2992// RenderWidget provides a communication bridge between a WebWidget and
93// a RenderWidgetHost, the latter of which lives in a different process.
dchengd96a27a2015-07-24 20:17:3294//
95// RenderWidget is used to implement:
96// - RenderViewImpl (deprecated)
97// - Fullscreen mode (RenderWidgetFullScreen)
98// - Popup "menus" (like the color chooser and date picker)
99// - Widgets for frames (for out-of-process iframe support)
[email protected]f3112a52011-09-30 23:47:49100class CONTENT_EXPORT RenderWidget
[email protected]c47317e2012-06-20 22:35:31101 : public IPC::Listener,
102 public IPC::Sender,
[email protected]180ef242013-11-07 06:50:46103 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient),
[email protected]f3112a52011-09-30 23:47:49104 public base::RefCounted<RenderWidget> {
initial.commit09911bf2008-07-26 23:55:29105 public:
106 // Creates a new RenderWidget. The opener_id is the routing ID of the
[email protected]380244092011-10-07 17:26:27107 // RenderView that this widget lives inside.
[email protected]0ebf3872008-11-07 21:35:03108 static RenderWidget* Create(int32 opener_id,
danakj6e3bf8012014-12-16 18:27:53109 CompositorDependencies* compositor_deps,
[email protected]180ef242013-11-07 06:50:46110 blink::WebPopupType popup_type,
111 const blink::WebScreenInfo& screen_info);
initial.commit09911bf2008-07-26 23:55:29112
kenrba7199832015-01-22 23:44:59113 // Creates a new RenderWidget that will be attached to a RenderFrame.
114 static RenderWidget* CreateForFrame(int routing_id,
kenrba7199832015-01-22 23:44:59115 bool hidden,
116 const blink::WebScreenInfo& screen_info,
117 CompositorDependencies* compositor_deps,
118 blink::WebLocalFrame* frame);
119
dchengda9b4bb2015-07-20 20:58:08120 // Closes a RenderWidget that was created by |CreateForFrame|.
121 void CloseForFrame();
[email protected]484955942010-08-19 16:13:18122
[email protected]4ee64622014-03-21 22:34:15123 int32 routing_id() const { return routing_id_; }
danakj6e3bf8012014-12-16 18:27:53124 CompositorDependencies* compositor_deps() const { return compositor_deps_; }
[email protected]180ef242013-11-07 06:50:46125 blink::WebWidget* webwidget() const { return webwidget_; }
[email protected]93b9d692011-04-13 00:44:31126 gfx::Size size() const { return size_; }
[email protected]589621b2010-09-23 22:01:07127 bool has_focus() const { return has_focus_; }
mikhail.pozdnyakovf2c902a92015-04-14 08:09:12128 bool is_fullscreen_granted() const { return is_fullscreen_granted_; }
mikhail.pozdnyakovc0e251b2015-04-15 06:51:12129 blink::WebDisplayMode display_mode() const { return display_mode_; }
[email protected]204f1df2012-01-04 20:21:13130 bool is_hidden() const { return is_hidden_; }
[email protected]4ee64622014-03-21 22:34:15131 bool handling_input_event() const { return handling_input_event_; }
132 // Temporary for debugging purposes...
133 bool closing() const { return closing_; }
134 bool is_swapped_out() { return is_swapped_out_; }
simonhong628f9812015-04-27 23:13:20135 bool for_oopif() { return for_oopif_; }
[email protected]4ee64622014-03-21 22:34:15136 ui::MenuSourceType context_menu_source_type() {
[email protected]be1af0662014-07-29 19:55:51137 return context_menu_source_type_;
138 }
139 bool has_host_context_menu_location() {
140 return has_host_context_menu_location_;
141 }
142 gfx::Point host_context_menu_location() {
143 return host_context_menu_location_;
[email protected]4ee64622014-03-21 22:34:15144 }
[email protected]589621b2010-09-23 22:01:07145
kenrba7199832015-01-22 23:44:59146 // ScreenInfo exposed so it can be passed to subframe RenderWidgets.
147 blink::WebScreenInfo screen_info() const { return screen_info_; }
148
[email protected]bffc8302014-01-23 20:52:16149 // Functions to track out-of-process frames for special notifications.
[email protected]e3244ed2014-06-20 20:04:27150 void RegisterRenderFrameProxy(RenderFrameProxy* proxy);
151 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy);
[email protected]bffc8302014-01-23 20:52:16152
[email protected]de3c5d82014-05-28 22:12:59153 // Functions to track all RenderFrame objects associated with this
154 // RenderWidget.
155 void RegisterRenderFrame(RenderFrameImpl* frame);
156 void UnregisterRenderFrame(RenderFrameImpl* frame);
157
[email protected]a017938b2014-05-27 21:17:17158#if defined(VIDEO_HOLE)
159 void RegisterVideoHoleFrame(RenderFrameImpl* frame);
160 void UnregisterVideoHoleFrame(RenderFrameImpl* frame);
161#endif // defined(VIDEO_HOLE)
162
[email protected]c47317e2012-06-20 22:35:31163 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52164 bool OnMessageReceived(const IPC::Message& msg) override;
initial.commit09911bf2008-07-26 23:55:29165
[email protected]c47317e2012-06-20 22:35:31166 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52167 bool Send(IPC::Message* msg) override;
initial.commit09911bf2008-07-26 23:55:29168
[email protected]180ef242013-11-07 06:50:46169 // blink::WebWidgetClient
avi5c77d212015-09-25 20:08:25170 void didAutoResize(const blink::WebSize& new_size) override;
171 void initializeLayerTreeView() override;
172 blink::WebLayerTreeView* layerTreeView() override;
173 void didFirstVisuallyNonEmptyLayout() override;
174 void didFirstLayoutAfterFinishedParsing() override;
175 void didFocus() override;
176 void didBlur() override;
177 void didChangeCursor(const blink::WebCursorInfo&) override;
178 void closeWidgetSoon() override;
179 void show(blink::WebNavigationPolicy) override;
180 blink::WebRect windowRect() override;
181 void setToolTipText(const blink::WebString& text,
182 blink::WebTextDirection hint) override;
183 void setWindowRect(const blink::WebRect&) override;
184 blink::WebRect windowResizerRect() override;
185 blink::WebRect rootWindowRect() override;
186 blink::WebScreenInfo screenInfo() override;
187 float deviceScaleFactor() override;
188 void resetInputMethod() override;
189 void didHandleGestureEvent(const blink::WebGestureEvent& event,
190 bool event_cancelled) override;
191 void didOverscroll(const blink::WebFloatSize& unusedDelta,
192 const blink::WebFloatSize& accumulatedRootOverScroll,
193 const blink::WebFloatPoint& position,
194 const blink::WebFloatSize& velocity) override;
195 void showImeIfNeeded() override;
[email protected]4873c7d2009-07-16 06:36:28196
donnda070f3c2015-01-16 19:54:11197#if defined(OS_ANDROID)
198 // Notifies that a tap was not consumed, so showing a UI for the unhandled
199 // tap may be needed.
donnd57e54f52015-02-26 19:03:37200 // Performs various checks on the given WebNode to apply heuristics to
201 // determine if triggering is appropriate.
avi5c77d212015-09-25 20:08:25202 void showUnhandledTapUIIfNeeded(const blink::WebPoint& tapped_position,
203 const blink::WebNode& tapped_node,
204 bool page_changed) override;
donnda070f3c2015-01-16 19:54:11205#endif
206
[email protected]7912e822014-04-16 02:37:03207 // Begins the compositor's scheduler to start producing frames.
208 void StartCompositor();
209
[email protected]aeeedad2014-08-22 18:16:22210 // Stop compositing.
ennef3c58142014-12-09 21:44:38211 void WillCloseLayerTreeView();
[email protected]aeeedad2014-08-22 18:16:22212
[email protected]4873c7d2009-07-16 06:36:28213 // Called when a plugin is moved. These events are queued up and sent with
214 // the next paint or scroll message to the host.
[email protected]29e2fb42013-07-19 01:13:47215 void SchedulePluginMove(const WebPluginGeometry& move);
initial.commit09911bf2008-07-26 23:55:29216
[email protected]268654772009-08-06 23:02:04217 // Called when a plugin window has been destroyed, to make sure the currently
218 // pending moves don't try to reference it.
219 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window);
220
[email protected]24ed0432013-04-24 07:50:31221 RenderWidgetCompositor* compositor() const;
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
[email protected]586871b2014-07-22 17:05:11234 // Deliveres |message| together with compositor state change updates. The
235 // exact behavior depends on |policy|.
236 // This mechanism is not a drop-in replacement for IPC: messages sent this way
237 // will not be automatically available to BrowserMessageFilter, for example.
238 // FIFO ordering is preserved between messages enqueued with the same
239 // |policy|, the ordering between messages enqueued for different policies is
240 // undefined.
241 //
242 // |msg| message to send, ownership of |msg| is transferred.
243 // |policy| see the comment on MessageDeliveryPolicy.
244 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy);
245
[email protected]66fca5bc2013-05-23 06:58:29246 // Handle common setup/teardown for handling IME events.
247 void StartHandlingImeEvent();
248 void FinishHandlingImeEvent();
249
[email protected]4ee64622014-03-21 22:34:15250 // Returns whether we currently should handle an IME event.
251 bool ShouldHandleImeEvent();
252
rouslanf7ebd8832015-01-22 01:54:14253 // Called by the compositor when page scale animation completed.
254 virtual void DidCompletePageScaleAnimation() {}
255
[email protected]c27dd4f2014-05-22 18:05:19256 // When paused in debugger, we send ack for mouse event early. This ensures
257 // that we continue receiving mouse moves and pass them to debugger. Returns
258 // whether we are paused in mouse move event and have sent the ack.
259 bool SendAckForMouseMoveFromDebugger();
260
261 // When resumed from pause in debugger while handling mouse move,
262 // we should not send an extra ack (see SendAckForMouseMoveFromDebugger).
263 void IgnoreAckForMouseMoveFromDebugger();
264
[email protected]b2e4c70132013-10-03 02:07:51265 // ScreenMetricsEmulator class manages screen emulation inside a render
266 // widget. This includes resizing, placing view on the screen at desired
267 // position, changing device scale factor, and scaling down the whole
268 // widget if required to fit into the browser window.
269 class ScreenMetricsEmulator;
270
[email protected]b2e4c70132013-10-03 02:07:51271 void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator);
[email protected]2d6836f42014-07-02 17:25:31272 gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor);
[email protected]b2e4c70132013-10-03 02:07:51273
jdduke491a3f0c2015-06-15 23:30:26274 // Indicates that the compositor is about to begin a frame. This is primarily
275 // to signal to flow control mechanisms that a frame is beginning, not to
276 // perform actual painting work.
277 void WillBeginCompositorFrame();
278
279 // Notifies about a compositor frame commit operation having finished.
280 virtual void DidCommitCompositorFrame();
281
282 // Notifies that the draw commands for a committed frame have been issued.
283 void DidCommitAndDrawCompositorFrame();
284
285 // Notifies that the compositor has posted a swapbuffers operation to the GPU
286 // process.
287 void DidCompleteSwapBuffers();
288
289 void ScheduleComposite();
[email protected]7d08a9352013-10-15 08:24:56290 void ScheduleCompositeWithForcedRedraw();
291
[email protected]4d7e46a2013-11-08 05:33:40292 // Called by the compositor in single-threaded mode when a swap is posted,
293 // completes or is aborted.
294 void OnSwapBuffersPosted();
295 void OnSwapBuffersComplete();
296 void OnSwapBuffersAborted();
297
[email protected]7a4e2532013-12-02 21:30:02298 // Checks if the selection bounds have been changed. If they are changed,
299 // the new value will be sent to the browser process.
300 void UpdateSelectionBounds();
301
[email protected]e5e438d62014-03-27 21:47:16302 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end);
303
[email protected]a09d53ce2014-01-31 00:46:42304 void OnShowHostContextMenu(ContextMenuParams* params);
[email protected]7a4e2532013-12-02 21:30:02305
[email protected]90f24152014-04-09 12:41:36306 enum ShowIme {
307 SHOW_IME_IF_NEEDED,
308 NO_SHOW_IME,
309 };
310
311 enum ChangeSource {
312 FROM_NON_IME,
313 FROM_IME,
314 };
315
316 // |show_ime| should be SHOW_IME_IF_NEEDED iff the update may cause the ime to
317 // be displayed, e.g. after a tap on an input field on mobile.
318 // |change_source| should be FROM_NON_IME when the renderer has to wait for
319 // the browser to acknowledge the change before the renderer handles any more
320 // IME events. This is when the text change did not originate from the IME in
321 // the browser side, such as changes by JavaScript or autofill.
322 void UpdateTextInputState(ShowIme show_ime, ChangeSource change_source);
[email protected]4ee64622014-03-21 22:34:15323
rouslanf7ebd8832015-01-22 01:54:14324 // Called when animations due to focus change have completed (if any). Can be
325 // called from the renderer, browser, or compositor.
326 virtual void FocusChangeComplete() {}
327
[email protected]7a4e2532013-12-02 21:30:02328 // Checks if the composition range or composition character bounds have been
329 // changed. If they are changed, the new value will be sent to the browser
yukawa5f21c6a2014-10-27 17:09:30330 // process. This method does nothing when the browser process is not able to
331 // handle composition range and composition character bounds.
[email protected]7a4e2532013-12-02 21:30:02332 void UpdateCompositionInfo(bool should_update_range);
[email protected]7a4e2532013-12-02 21:30:02333
[email protected]a4f0d882014-05-01 23:48:10334#if defined(OS_ANDROID)
boliu15ca2652015-09-04 23:33:40335 virtual bool DoesRecordFullLayer() const;
[email protected]a4f0d882014-05-01 23:48:10336#endif
337
ennef3c58142014-12-09 21:44:38338 bool host_closing() const { return host_closing_; }
339
initial.commit09911bf2008-07-26 23:55:29340 protected:
[email protected]8085dbc82008-09-26 22:53:44341 // Friend RefCounted so that the dtor can be non-public. Using this class
342 // without ref-counting is an error.
343 friend class base::RefCounted<RenderWidget>;
[email protected]7339cd22010-10-27 00:11:20344 // For unit tests.
[email protected]e9ff79c2012-10-19 21:31:26345 friend class RenderWidgetTest;
[email protected]8085dbc82008-09-26 22:53:44346
[email protected]61e2b3cc2012-03-02 16:13:34347 enum ResizeAck {
348 SEND_RESIZE_ACK,
349 NO_RESIZE_ACK,
350 };
351
dcheng35d31c112015-07-22 00:17:36352 RenderWidget(CompositorDependencies* compositor_deps,
353 blink::WebPopupType popup_type,
[email protected]180ef242013-11-07 06:50:46354 const blink::WebScreenInfo& screen_info,
[email protected]1ac10dca2013-08-20 20:47:04355 bool swapped_out,
[email protected]7912e822014-04-16 02:37:03356 bool hidden,
357 bool never_visible);
[email protected]ce2b28e2012-08-09 15:53:57358
dcheng6d18e402014-10-21 12:32:52359 ~RenderWidget() override;
initial.commit09911bf2008-07-26 23:55:29360
dchengda9b4bb2015-07-20 20:58:08361 static blink::WebWidget* CreateWebFrameWidget(RenderWidget* render_widget,
362 blink::WebLocalFrame* frame);
363
364 // Creates a WebWidget based on the popup type.
365 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget);
366
pimanc4af3072015-10-02 03:45:59367 // Initializes this view with the given opener.
dcheng35d31c112015-07-22 00:17:36368 bool Init(int32 opener_id);
initial.commit09911bf2008-07-26 23:55:29369
[email protected]484955942010-08-19 16:13:18370 // Called by Init and subclasses to perform initialization.
[email protected]a635f942012-12-07 10:34:29371 bool DoInit(int32 opener_id,
[email protected]180ef242013-11-07 06:50:46372 blink::WebWidget* web_widget,
[email protected]484955942010-08-19 16:13:18373 IPC::SyncMessage* create_widget_message);
374
[email protected]992db4c2011-05-12 15:37:15375 // Sets whether this RenderWidget has been swapped out to be displayed by
376 // a RenderWidget in a different process. If so, no new IPC messages will be
377 // sent (only ACKs) and the process is free to exit when there are no other
378 // active RenderWidgets.
379 void SetSwappedOut(bool is_swapped_out);
380
[email protected]949b6592014-08-20 13:17:52381 // Allows the process to exit once the unload handler has finished, if there
382 // are no other active RenderWidgets.
383 void WasSwappedOut();
384
[email protected]fd847792013-10-24 17:12:35385 void FlushPendingInputEventAck();
[email protected]2533ce12009-05-09 00:02:24386 void DoDeferredClose();
dgozmancf9039cd2015-04-06 12:01:31387 void NotifyOnClose();
dchengda9b4bb2015-07-20 20:58:08388
389 // Close the underlying WebWidget.
390 virtual void Close();
initial.commit09911bf2008-07-26 23:55:29391
[email protected]61e2b3cc2012-03-02 16:13:34392 // Resizes the render widget.
393 void Resize(const gfx::Size& new_size,
[email protected]60d47ac2013-03-01 23:42:44394 const gfx::Size& physical_backing_size,
dtrainorcb7779b82014-12-04 01:08:02395 bool top_controls_shrink_blink_size,
396 float top_controls_height,
[email protected]bb6378fe2014-04-28 21:19:44397 const gfx::Size& visible_viewport_size,
[email protected]61e2b3cc2012-03-02 16:13:34398 const gfx::Rect& resizer_rect,
mikhail.pozdnyakovf2c902a92015-04-14 08:09:12399 bool is_fullscreen_granted,
mikhail.pozdnyakovc0e251b2015-04-15 06:51:12400 blink::WebDisplayMode display_mode,
[email protected]61e2b3cc2012-03-02 16:13:34401 ResizeAck resize_ack);
[email protected]92650162013-10-30 03:31:02402 // Used to force the size of a window when running layout tests.
bokanc007c3a2015-02-03 07:15:56403 void SetWindowRectSynchronously(const gfx::Rect& new_window_rect);
[email protected]b2e4c70132013-10-03 02:07:51404 virtual void SetScreenMetricsEmulationParameters(
dgozman9260b0a12015-03-16 13:45:20405 bool enabled,
406 const blink::WebDeviceEmulationParams& params);
[email protected]53907862014-03-25 15:42:40407#if defined(OS_MACOSX) || defined(OS_ANDROID)
[email protected]b2e4c70132013-10-03 02:07:51408 void SetExternalPopupOriginAdjustmentsForEmulation(
409 ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator);
[email protected]53907862014-03-25 15:42:40410#endif
[email protected]61e2b3cc2012-03-02 16:13:34411
initial.commit09911bf2008-07-26 23:55:29412 // RenderWidget IPC message handlers
[email protected]180ef242013-11-07 06:50:46413 void OnHandleInputEvent(const blink::WebInputEvent* event,
[email protected]205294b2014-03-18 20:48:35414 const ui::LatencyInfo& latency_info,
[email protected]c084330e02013-04-27 01:08:15415 bool keyboard_shortcut);
[email protected]34202de2013-05-06 23:36:22416 void OnCursorVisibilityChange(bool is_visible);
[email protected]c084330e02013-04-27 01:08:15417 void OnMouseCaptureLost();
418 virtual void OnSetFocus(bool enable);
naskoc288745f2015-05-01 22:54:21419 void OnClose();
[email protected]fc4404d2012-11-07 19:53:30420 void OnCreatingNewAck();
[email protected]0fdd5012013-05-29 08:05:56421 virtual void OnResize(const ViewMsg_Resize_Params& params);
dgozman9260b0a12015-03-16 13:45:20422 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params);
423 void OnDisableDeviceEmulation();
noel89949e62014-09-30 01:12:41424 void OnColorProfile(const std::vector<char>& color_profile);
[email protected]b5913d72012-02-07 22:26:54425 void OnChangeResizeRect(const gfx::Rect& resizer_rect);
[email protected]941e4552010-02-01 21:23:43426 virtual void OnWasHidden();
[email protected]3399dd822014-08-09 11:14:24427 virtual void OnWasShown(bool needs_repainting,
428 const ui::LatencyInfo& latency_info);
[email protected]8400e032010-02-26 18:50:11429 void OnCreateVideoAck(int32 video_id);
430 void OnUpdateVideoAck(int32 video_id);
[email protected]2533ce12009-05-09 00:02:24431 void OnRequestMoveAck();
[email protected]56ea1a62011-05-30 07:05:57432 virtual void OnImeSetComposition(
[email protected]fcf75d42013-12-03 20:11:26433 const base::string16& text,
[email protected]180ef242013-11-07 06:50:46434 const std::vector<blink::WebCompositionUnderline>& underlines,
[email protected]fa7b1dc2010-06-23 17:53:04435 int selection_start,
436 int selection_end);
[email protected]fcf75d42013-12-03 20:11:26437 virtual void OnImeConfirmComposition(const base::string16& text,
[email protected]db4fc1e22013-09-06 20:01:51438 const gfx::Range& replacement_range,
[email protected]0e45bd02013-07-12 20:20:02439 bool keep_selection);
[email protected]0bc1f572013-04-17 01:46:31440 void OnRepaint(gfx::Size size_to_paint);
[email protected]79fa22e2013-08-23 15:18:12441 void OnSyntheticGestureCompleted();
[email protected]180ef242013-11-07 06:50:46442 void OnSetTextDirection(blink::WebTextDirection direction);
[email protected]872ae5b2011-05-26 20:20:50443 void OnGetFPS();
[email protected]80ad8622012-11-07 16:33:03444 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
445 const gfx::Rect& window_screen_rect);
[email protected]2384b6cb2013-02-28 23:58:51446 void OnShowImeIfNeeded();
kenrbb4e2a3b2015-05-14 15:05:05447 void OnSetSurfaceIdNamespace(uint32_t surface_id_namespace);
[email protected]0d1ebed12013-08-05 22:01:13448
[email protected]adb362312014-06-28 06:04:24449#if defined(OS_ANDROID)
changwan3a841162015-08-11 02:53:37450 // Called when we send IME event that expects an ACK.
451 void OnImeEventSentForAck(const blink::WebTextInputInfo& info);
[email protected]0d1ebed12013-08-05 22:01:13452
453 // Called by the browser process for every required IME acknowledgement.
454 void OnImeEventAck();
[email protected]105dffb42013-02-20 03:46:21455#endif
[email protected]0d1ebed12013-08-05 22:01:13456
[email protected]847a2582013-03-09 02:29:51457 // Notify the compositor about a change in viewport size. This should be
458 // used only with auto resize mode WebWidgets, as normal WebWidgets should
459 // go through OnResize.
[email protected]97e1bf72013-03-06 14:06:05460 void AutoResizeCompositor();
461
[email protected]468ac582012-11-20 00:53:19462 virtual void SetDeviceScaleFactor(float device_scale_factor);
[email protected]28ed6b32014-06-08 02:16:27463 virtual bool SetDeviceColorProfile(const std::vector<char>& color_profile);
noeldb4df152014-09-16 17:45:20464 virtual void ResetDeviceColorProfileForTesting();
[email protected]468ac582012-11-20 00:53:19465
[email protected]fcdc5642014-05-09 14:32:24466 virtual void OnOrientationChange();
467
[email protected]29ed96a2012-02-04 18:12:16468 // Override points to notify derived classes that a paint has happened.
[email protected]0704ac32013-10-03 15:24:22469 // DidInitiatePaint happens when that has completed, and subsequent rendering
470 // won't affect the painted content. DidFlushPaint happens once we've received
471 // the ACK that the screen has been updated. For a given paint operation,
472 // these overrides will always be called in the order DidInitiatePaint,
473 // DidFlushPaint.
[email protected]00c39612010-03-06 02:53:28474 virtual void DidInitiatePaint() {}
475 virtual void DidFlushPaint() {}
[email protected]a2f6bc112009-06-27 16:27:25476
[email protected]ed7defa2013-03-12 21:29:59477 virtual GURL GetURLForGraphicsContext3D();
[email protected]65225772011-05-12 21:10:24478
[email protected]d54169e92011-01-21 09:19:52479 // Gets the scroll offset of this widget, if this widget has a notion of
480 // scroll offset.
[email protected]ceb36f7d2012-10-31 18:33:24481 virtual gfx::Vector2d GetScrollOffset();
[email protected]d54169e92011-01-21 09:19:52482
[email protected]bee16aab2009-08-26 15:55:03483 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
484 // use this method so that we can properly inform the RenderThread of our
485 // state.
486 void SetHidden(bool hidden);
487
[email protected]2b624c562011-10-27 22:58:26488 void DidToggleFullscreen();
489
[email protected]674741932009-02-04 23:44:46490 bool next_paint_is_resize_ack() const;
[email protected]674741932009-02-04 23:44:46491 void set_next_paint_is_resize_ack();
[email protected]674741932009-02-04 23:44:46492 void set_next_paint_is_repaint_ack();
[email protected]ec7dc112008-08-06 05:30:12493
[email protected]586871b2014-07-22 17:05:11494 // QueueMessage implementation extracted into a static method for easy
495 // testing.
496 static scoped_ptr<cc::SwapPromise> QueueMessageImpl(
497 IPC::Message* msg,
498 MessageDeliveryPolicy policy,
499 FrameSwapMessageQueue* frame_swap_message_queue,
500 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter,
[email protected]586871b2014-07-22 17:05:11501 int source_frame_number);
502
[email protected]56ea1a62011-05-30 07:05:57503 // Override point to obtain that the current input method state and caret
504 // position.
[email protected]ad26ef42011-06-17 07:59:45505 virtual ui::TextInputType GetTextInputType();
[email protected]5b739cb2012-08-21 20:35:21506 virtual ui::TextInputType WebKitToUiTextInputType(
[email protected]180ef242013-11-07 06:50:46507 blink::WebTextInputType type);
[email protected]ad26ef42011-06-17 07:59:45508
[email protected]58b48a0df22012-06-13 07:01:35509 // Override point to obtain that the current composition character bounds.
510 // In the case of surrogate pairs, the character is treated as two characters:
511 // the bounds for first character is actual one, and the bounds for second
512 // character is zero width rectangle.
513 virtual void GetCompositionCharacterBounds(
514 std::vector<gfx::Rect>* character_bounds);
515
[email protected]88dbe32f2013-06-20 23:31:36516 // Returns the range of the text that is being composed or the selection if
517 // the composition does not exist.
[email protected]db4fc1e22013-09-06 20:01:51518 virtual void GetCompositionRange(gfx::Range* range);
[email protected]88dbe32f2013-06-20 23:31:36519
[email protected]58b48a0df22012-06-13 07:01:35520 // Returns true if the composition range or composition character bounds
521 // should be sent to the browser process.
522 bool ShouldUpdateCompositionInfo(
[email protected]db4fc1e22013-09-06 20:01:51523 const gfx::Range& range,
[email protected]58b48a0df22012-06-13 07:01:35524 const std::vector<gfx::Rect>& bounds);
525
[email protected]ad26ef42011-06-17 07:59:45526 // Override point to obtain that the current input method state about
527 // composition text.
528 virtual bool CanComposeInline();
[email protected]56ea1a62011-05-30 07:05:57529
[email protected]2533ce12009-05-09 00:02:24530 // Set the pending window rect.
531 // Because the real render_widget is hosted in another process, there is
532 // a time period where we may have set a new window rect which has not yet
533 // been processed by the browser. So we maintain a pending window rect
534 // size. If JS code sets the WindowRect, and then immediately calls
535 // GetWindowRect() we'll use this pending window rect as the size.
[email protected]180ef242013-11-07 06:50:46536 void SetPendingWindowRect(const blink::WebRect& r);
[email protected]2533ce12009-05-09 00:02:24537
[email protected]446705872009-09-10 07:22:48538 // Called by OnHandleInputEvent() to notify subclasses that a key event was
539 // just handled.
540 virtual void DidHandleKeyEvent() {}
541
[email protected]67bfb83f2011-09-22 03:36:37542 // Called by OnHandleInputEvent() to notify subclasses that a mouse event is
543 // about to be handled.
544 // Returns true if no further handling is needed. In that case, the event
545 // won't be sent to WebKit or trigger DidHandleMouseEvent().
[email protected]180ef242013-11-07 06:50:46546 virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event);
[email protected]67bfb83f2011-09-22 03:36:37547
[email protected]41d86852012-11-07 12:23:24548 // Called by OnHandleInputEvent() to notify subclasses that a gesture event is
549 // about to be handled.
550 // Returns true if no further handling is needed. In that case, the event
551 // won't be sent to WebKit.
[email protected]180ef242013-11-07 06:50:46552 virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event);
[email protected]41d86852012-11-07 12:23:24553
ccamerond4ba47902014-12-17 07:20:31554 // Called by OnHandleInputEvent() to forward a mouse wheel event to the
555 // compositor thread, to effect the elastic overscroll effect.
ccamerona7644752014-12-30 01:16:31556 void ObserveWheelEventAndResult(const blink::WebMouseWheelEvent& wheel_event,
sataya.mf405d0e2015-07-07 16:51:11557 const gfx::Vector2dF& wheel_unused_delta,
ccamerona7644752014-12-30 01:16:31558 bool event_processed);
ccamerond4ba47902014-12-17 07:20:31559
[email protected]3d5c243b2012-11-30 00:26:01560 // Check whether the WebWidget has any touch event handlers registered
561 // at the given point.
562 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const;
563
[email protected]ce6689f2013-03-29 12:52:55564 // Check whether the WebWidget has any touch event handlers registered.
avi5c77d212015-09-25 20:08:25565 void hasTouchEventHandlers(bool has_handlers) override;
[email protected]ce6689f2013-03-29 12:52:55566
[email protected]5d0bbdfa92013-12-10 00:35:51567 // Tell the browser about the actions permitted for a new touch point.
avi5c77d212015-09-25 20:08:25568 void setTouchAction(blink::WebTouchAction touch_action) override;
[email protected]5d0bbdfa92013-12-10 00:35:51569
[email protected]90f24152014-04-09 12:41:36570 // Called when value of focused text field gets dirty, e.g. value is modified
571 // by script, not by user input.
avi5c77d212015-09-25 20:08:25572 void didUpdateTextOfFocusedElementByNonUserInput() override;
[email protected]90f24152014-04-09 12:41:36573
[email protected]ed7defa2013-03-12 21:29:59574 // Creates a 3D context associated with this view.
jbauman5e420d32015-08-05 09:33:01575 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D(
576 bool compositor);
[email protected]ed7defa2013-03-12 21:29:59577
initial.commit09911bf2008-07-26 23:55:29578 // Routing ID that allows us to communicate to the parent browser process
579 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
580 int32 routing_id_;
581
danakj6e3bf8012014-12-16 18:27:53582 // Dependencies for initializing a compositor, including flags for optional
583 // features.
dcheng35d31c112015-07-22 00:17:36584 CompositorDependencies* const compositor_deps_;
danakj6e3bf8012014-12-16 18:27:53585
[email protected]c5b3b5e2009-02-13 06:41:11586 // We are responsible for destroying this object via its Close method.
[email protected]4ee64622014-03-21 22:34:15587 // May be NULL when the window is closing.
[email protected]180ef242013-11-07 06:50:46588 blink::WebWidget* webwidget_;
initial.commit09911bf2008-07-26 23:55:29589
[email protected]8926c602013-01-23 05:32:06590 // This is lazily constructed and must not outlive webwidget_.
[email protected]ba91a792013-02-06 09:48:28591 scoped_ptr<RenderWidgetCompositor> compositor_;
[email protected]8926c602013-01-23 05:32:06592
initial.commit09911bf2008-07-26 23:55:29593 // Set to the ID of the view that initiated creating this view, if any. When
594 // the view was initiated by the browser (the common case), this will be
595 // MSG_ROUTING_NONE. This is used in determining ownership when opening
596 // child tabs. See RenderWidget::createWebViewWithRequest.
597 //
598 // This ID may refer to an invalid view if that view is closed before this
599 // view is.
600 int32 opener_id_;
601
bokanc007c3a2015-02-03 07:15:56602 // The rect where this view should be initially shown.
603 gfx::Rect initial_rect_;
initial.commit09911bf2008-07-26 23:55:29604
initial.commit09911bf2008-07-26 23:55:29605 // We store the current cursor object so we can avoid spamming SetCursor
606 // messages.
607 WebCursor current_cursor_;
[email protected]88efb7ec2009-07-14 16:32:59608
initial.commit09911bf2008-07-26 23:55:29609 // The size of the RenderWidget.
610 gfx::Size size_;
611
[email protected]60d47ac2013-03-01 23:42:44612 // The size of the view's backing surface in non-DPI-adjusted pixels.
613 gfx::Size physical_backing_size_;
614
dtrainorcb7779b82014-12-04 01:08:02615 // Whether or not Blink's viewport size should be shrunk by the height of the
616 // URL-bar (always false on platforms where URL-bar hiding isn't supported).
617 bool top_controls_shrink_blink_size_;
618
619 // The height of the top controls (always 0 on platforms where URL-bar hiding
620 // isn't supported).
621 float top_controls_height_;
[email protected]d9083762013-03-24 01:36:40622
[email protected]bb6378fe2014-04-28 21:19:44623 // The size of the visible viewport in DPI-adjusted pixels.
624 gfx::Size visible_viewport_size_;
625
[email protected]f21c613a2009-02-12 14:46:17626 // The area that must be reserved for drawing the resize corner.
627 gfx::Rect resizer_rect_;
628
[email protected]53d3f302009-12-21 04:42:05629 // Flags for the next ViewHostMsg_UpdateRect message.
initial.commit09911bf2008-07-26 23:55:29630 int next_paint_flags_;
631
[email protected]847a2582013-03-09 02:29:51632 // Whether the WebWidget is in auto resize mode, which is used for example
633 // by extension popups.
634 bool auto_resize_mode_;
635
[email protected]ea3ee0a2012-05-15 03:43:09636 // True if we need to send an UpdateRect message to notify the browser about
637 // an already-completed auto-resize.
638 bool need_update_rect_for_auto_resize_;
639
initial.commit09911bf2008-07-26 23:55:29640 // Set to true if we should ignore RenderWidget::Show calls.
641 bool did_show_;
642
643 // Indicates that we shouldn't bother generated paint events.
644 bool is_hidden_;
645
[email protected]7912e822014-04-16 02:37:03646 // Indicates that we are never visible, so never produce graphical output.
sievers71c62dd52015-10-07 01:44:39647 const bool compositor_never_visible_;
[email protected]7912e822014-04-16 02:37:03648
mikhail.pozdnyakovf2c902a92015-04-14 08:09:12649 // Indicates whether tab-initiated fullscreen was granted.
650 bool is_fullscreen_granted_;
[email protected]ee41e7d22011-10-14 19:34:09651
mikhail.pozdnyakovc0e251b2015-04-15 06:51:12652 // Indicates the display mode.
653 blink::WebDisplayMode display_mode_;
654
initial.commit09911bf2008-07-26 23:55:29655 // Indicates whether we have been focused/unfocused by the browser.
656 bool has_focus_;
657
[email protected]5dd768212009-08-13 23:34:49658 // Are we currently handling an input event?
659 bool handling_input_event_;
660
jddukec05612b2015-06-25 23:13:18661 // Used to intercept overscroll notifications while an event is being
662 // handled. If the event causes overscroll, the overscroll metadata can be
663 // bundled in the event ack, saving an IPC. Note that we must continue
664 // supporting overscroll IPC notifications due to fling animation updates.
665 scoped_ptr<DidOverscrollParams>* handling_event_overscroll_;
666
[email protected]e8f775f2013-02-14 21:00:50667 // Are we currently handling an ime event?
668 bool handling_ime_event_;
669
[email protected]c27dd4f2014-05-22 18:05:19670 // Type of the input event we are currently handling.
671 blink::WebInputEvent::Type handling_event_type_;
672
673 // Whether we should not send ack for the current mouse move.
674 bool ignore_ack_for_mouse_move_from_debugger_;
[email protected]5d0bbdfa92013-12-10 00:35:51675
initial.commit09911bf2008-07-26 23:55:29676 // True if we have requested this widget be closed. No more messages will
677 // be sent, except for a Close.
678 bool closing_;
679
[email protected]aeeedad2014-08-22 18:16:22680 // True if it is known that the host is in the process of being shut down.
681 bool host_closing_;
682
[email protected]992db4c2011-05-12 15:37:15683 // Whether this RenderWidget is currently swapped out, such that the view is
684 // being rendered by another process. If all RenderWidgets in a process are
685 // swapped out, the process can exit.
686 bool is_swapped_out_;
687
simonhong628f9812015-04-27 23:13:20688 // TODO(simonhong): Remove this when we enable BeginFrame scheduling for
689 // OOPIF(crbug.com/471411).
690 // Whether this RenderWidget is for an out-of-process iframe or not.
691 bool for_oopif_;
692
[email protected]5b739cb2012-08-21 20:35:21693 // Stores information about the current text input.
[email protected]180ef242013-11-07 06:50:46694 blink::WebTextInputInfo text_input_info_;
[email protected]5b739cb2012-08-21 20:35:21695
[email protected]fa7b1dc2010-06-23 17:53:04696 // Stores the current text input type of |webwidget_|.
[email protected]ad26ef42011-06-17 07:59:45697 ui::TextInputType text_input_type_;
698
[email protected]b256eca2013-07-11 10:57:40699 // Stores the current text input mode of |webwidget_|.
700 ui::TextInputMode text_input_mode_;
701
shuchen82ce8c522014-10-23 01:55:20702 // Stores the current text input flags of |webwidget_|.
703 int text_input_flags_;
704
[email protected]86ba5fcb2013-09-04 00:36:53705 // Stores the current type of composition text rendering of |webwidget_|.
706 bool can_compose_inline_;
707
[email protected]e99ef6f2011-10-16 01:13:00708 // Stores the current selection bounds.
[email protected]7c8873e2013-02-05 08:03:01709 gfx::Rect selection_focus_rect_;
710 gfx::Rect selection_anchor_rect_;
initial.commit09911bf2008-07-26 23:55:29711
[email protected]58b48a0df22012-06-13 07:01:35712 // Stores the current composition character bounds.
713 std::vector<gfx::Rect> composition_character_bounds_;
714
715 // Stores the current composition range.
[email protected]db4fc1e22013-09-06 20:01:51716 gfx::Range composition_range_;
[email protected]58b48a0df22012-06-13 07:01:35717
[email protected]3e2b375b2010-04-07 17:03:12718 // The kind of popup this widget represents, NONE if not a popup.
[email protected]180ef242013-11-07 06:50:46719 blink::WebPopupType popup_type_;
[email protected]0ebf3872008-11-07 21:35:03720
initial.commit09911bf2008-07-26 23:55:29721 // Holds all the needed plugin window moves for a scroll.
[email protected]29e2fb42013-07-19 01:13:47722 typedef std::vector<WebPluginGeometry> WebPluginGeometryVector;
[email protected]268654772009-08-06 23:02:04723 WebPluginGeometryVector plugin_window_moves_;
initial.commit09911bf2008-07-26 23:55:29724
[email protected]80ad8622012-11-07 16:33:03725 // While we are waiting for the browser to update window sizes, we track the
726 // pending size temporarily.
[email protected]2533ce12009-05-09 00:02:24727 int pending_window_rect_count_;
[email protected]180ef242013-11-07 06:50:46728 blink::WebRect pending_window_rect_;
[email protected]2533ce12009-05-09 00:02:24729
[email protected]80ad8622012-11-07 16:33:03730 // The screen rects of the view and the window that contains it.
731 gfx::Rect view_screen_rect_;
732 gfx::Rect window_screen_rect_;
733
[email protected]12fbad812009-09-01 18:21:24734 scoped_ptr<IPC::Message> pending_input_event_ack_;
735
[email protected]fd847792013-10-24 17:12:35736 // The time spent in input handlers this frame. Used to throttle input acks.
737 base::TimeDelta total_input_handling_time_this_frame_;
738
[email protected]b68a0e52011-12-08 15:11:12739 // Indicates if the next sequence of Char events should be suppressed or not.
740 bool suppress_next_char_events_;
741
[email protected]842f10652012-06-06 01:54:04742 // Properties of the screen hosting this RenderWidget instance.
[email protected]180ef242013-11-07 06:50:46743 blink::WebScreenInfo screen_info_;
[email protected]842f10652012-06-06 01:54:04744
[email protected]f1cccb32012-06-06 18:29:59745 // The device scale factor. This value is computed from the DPI entries in
746 // |screen_info_| on some platforms, and defaults to 1 on other platforms.
[email protected]faec7b12012-06-19 14:42:13747 float device_scale_factor_;
[email protected]f1cccb32012-06-06 18:29:59748
[email protected]28ed6b32014-06-08 02:16:27749 // The device color profile on supported platforms.
750 std::vector<char> device_color_profile_;
751
[email protected]9017d7852013-11-21 17:47:35752 // State associated with synthetic gestures. Synthetic gestures are processed
753 // in-order, so a queue is sufficient to identify the correct state for a
754 // completed gesture.
755 std::queue<SyntheticGestureCompletionCallback>
756 pending_synthetic_gesture_callbacks_;
[email protected]0e241b4b2012-08-18 09:06:27757
[email protected]53b4cc12013-07-18 23:02:30758 uint32 next_output_surface_id_;
759
[email protected]0d1ebed12013-08-05 22:01:13760#if defined(OS_ANDROID)
[email protected]90f24152014-04-09 12:41:36761 // Indicates value in the focused text field is in dirty state, i.e. modified
762 // by script etc., not by user input.
763 bool text_field_is_dirty_;
764
changwan3a841162015-08-11 02:53:37765 // Stores the history of text input infos from the last ACK'ed one from the
766 // current one. The size is the number of pending ACKs plus one, since we
767 // intentionally keep the last ack'd value to know what the browser is
768 // currently aware of.
769 std::deque<blink::WebTextInputInfo> text_input_info_history_;
[email protected]0d1ebed12013-08-05 22:01:13770#endif
771
[email protected]b2e4c70132013-10-03 02:07:51772 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_;
773
774 // Popups may be displaced when screen metrics emulation is enabled.
775 // These values are used to properly adjust popup position.
dgozman9260b0a12015-03-16 13:45:20776 gfx::PointF popup_view_origin_for_emulation_;
777 gfx::PointF popup_screen_origin_for_emulation_;
[email protected]b2e4c70132013-10-03 02:07:51778 float popup_origin_scale_for_emulation_;
779
[email protected]586871b2014-07-22 17:05:11780 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
[email protected]5b45ad42013-10-25 00:42:04781 scoped_ptr<ResizingModeSelector> resizing_mode_selector_;
782
[email protected]e3244ed2014-06-20 20:04:27783 // Lists of RenderFrameProxy objects that need to be notified of
784 // compositing-related events (e.g. DidCommitCompositorFrame).
brettw236d3172015-06-03 16:31:43785 base::ObserverList<RenderFrameProxy> render_frame_proxies_;
[email protected]a017938b2014-05-27 21:17:17786#if defined(VIDEO_HOLE)
brettw236d3172015-06-03 16:31:43787 base::ObserverList<RenderFrameImpl> video_hole_frames_;
[email protected]a017938b2014-05-27 21:17:17788#endif // defined(VIDEO_HOLE)
[email protected]bffc8302014-01-23 20:52:16789
[email protected]de3c5d82014-05-28 22:12:59790 // A list of RenderFrames associated with this RenderWidget. Notifications
791 // are sent to each frame in the list for events such as changing
792 // visibility state for example.
brettw236d3172015-06-03 16:31:43793 base::ObserverList<RenderFrameImpl> render_frames_;
[email protected]de3c5d82014-05-28 22:12:59794
[email protected]a09d53ce2014-01-31 00:46:42795 ui::MenuSourceType context_menu_source_type_;
[email protected]be1af0662014-07-29 19:55:51796 bool has_host_context_menu_location_;
797 gfx::Point host_context_menu_location_;
[email protected]a09d53ce2014-01-31 00:46:42798
[email protected]05d478752009-04-08 23:38:16799 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
initial.commit09911bf2008-07-26 23:55:29800};
801
[email protected]e9ff79c2012-10-19 21:31:26802} // namespace content
803
[email protected]2cff0052011-03-18 16:51:44804#endif // CONTENT_RENDERER_RENDER_WIDGET_H_