blob: a4fc4a005098ea186a4d13ba59fdc945fd74bc74 [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]0e241b4b2012-08-18 09:06:2711#include <map>
dchengcedca5612016-04-09 01:40:1512#include <memory>
xlai180af792016-08-26 22:07:4213#include <queue>
pwnallef669312017-01-07 01:17:2914#include <string>
15#include <vector>
[email protected]010ea08a2009-10-11 20:21:3216
[email protected]586871b2014-07-22 17:05:1117#include "base/callback.h"
Fady Samuel1ee6fb5c2018-02-16 03:27:4618#include "base/cancelable_callback.h"
[email protected]f3112a52011-09-30 23:47:4919#include "base/compiler_specific.h"
avi1023d012015-12-25 02:39:1420#include "base/macros.h"
[email protected]3b63f8f42011-03-28 01:54:1521#include "base/memory/ref_counted.h"
wjmaclean1d970622017-01-21 22:28:2422#include "base/memory/weak_ptr.h"
[email protected]bffc8302014-01-23 20:52:1623#include "base/observer_list.h"
Gabriel Charette14520232018-04-30 23:27:2224#include "base/single_thread_task_runner.h"
[email protected]abb522162013-06-28 01:54:1625#include "base/time/time.h"
avi1023d012015-12-25 02:39:1426#include "build/build_config.h"
Sandra Sunac5cdd832017-12-11 03:27:1327#include "cc/input/overscroll_behavior.h"
xidachenfa0199e72017-05-11 11:34:2628#include "cc/input/touch_action.h"
danakj4b347212018-07-04 17:55:1729#include "cc/trees/layer_tree_settings.h"
30#include "cc/trees/managed_memory_policy.h"
Fady Samuel644df1d2017-07-13 01:13:0231#include "components/viz/common/surfaces/local_surface_id.h"
Scott Violetc78fef732018-03-06 17:42:5332#include "content/common/buildflags.h"
[email protected]f3112a52011-09-30 23:47:4933#include "content/common/content_export.h"
[email protected]c2809346d2014-03-20 00:11:0334#include "content/common/cursors/webcursor.h"
paulmeyer6ef5a792016-11-08 20:33:5835#include "content/common/drag_event_source_info.h"
alexmos56567492016-09-13 00:52:4636#include "content/common/edit_command.h"
Dave Tapuska1bdf1832017-07-07 18:07:1937#include "content/common/widget.mojom.h"
paulmeyer90f6c31d2016-11-12 00:17:5938#include "content/public/common/drop_data.h"
ccameron2f451532016-09-07 21:49:2739#include "content/public/common/screen_info.h"
Sadrul Habib Chowdhury31c98712018-12-11 04:15:1340#include "content/renderer/compositor/layer_tree_view_delegate.h"
mfomitchev2600fd7c2016-02-17 20:53:3941#include "content/renderer/devtools/render_widget_screen_metrics_emulator_delegate.h"
dtapuska9ec1a912017-04-21 15:18:3142#include "content/renderer/input/main_thread_event_queue.h"
fsamuel72464894f2015-12-15 06:59:3143#include "content/renderer/input/render_widget_input_handler.h"
44#include "content/renderer/input/render_widget_input_handler_delegate.h"
lfgbee1e0a2016-06-08 21:24:2145#include "content/renderer/mouse_lock_dispatcher.h"
Albert J. Wong7bbf22d2018-12-20 00:27:2746#include "content/renderer/render_widget_delegate.h"
lfgbee1e0a2016-06-08 21:24:2147#include "content/renderer/render_widget_mouse_lock_dispatcher.h"
[email protected]4f86bdb2012-11-10 19:11:1948#include "ipc/ipc_listener.h"
nick4df698d82016-11-11 20:39:2349#include "ipc/ipc_message.h"
[email protected]4f86bdb2012-11-10 19:11:1950#include "ipc/ipc_sender.h"
Dave Tapuska1bdf1832017-07-07 18:07:1951#include "mojo/public/cpp/bindings/binding.h"
Scott Violet02e38b92018-03-27 23:42:1452#include "ppapi/buildflags/buildflags.h"
Richard Li49fe04d2018-10-21 09:07:1953#include "services/network/public/mojom/referrer_policy.mojom.h"
Dmitry Gozman88ca5a992018-05-18 00:13:3354#include "third_party/blink/public/common/manifest/web_display_mode.h"
Blink Reformata30d4232018-04-07 15:31:0655#include "third_party/blink/public/platform/web_input_event.h"
56#include "third_party/blink/public/platform/web_rect.h"
Blink Reformata30d4232018-04-07 15:31:0657#include "third_party/blink/public/platform/web_text_input_info.h"
58#include "third_party/blink/public/web/web_ime_text_span.h"
Blink Reformata30d4232018-04-07 15:31:0659#include "third_party/blink/public/web/web_text_direction.h"
60#include "third_party/blink/public/web/web_widget.h"
61#include "third_party/blink/public/web/web_widget_client.h"
[email protected]b256eca2013-07-11 10:57:4062#include "ui/base/ime/text_input_mode.h"
[email protected]ad26ef42011-06-17 07:59:4563#include "ui/base/ime/text_input_type.h"
[email protected]a09d53ce2014-01-31 00:46:4264#include "ui/base/ui_base_types.h"
tfarina93bfa912014-12-05 14:23:1565#include "ui/gfx/geometry/rect.h"
tfarina93bfa912014-12-05 14:23:1566#include "ui/gfx/geometry/vector2d_f.h"
[email protected]08397d52011-02-05 01:53:3867#include "ui/gfx/native_widget_types.h"
[email protected]db4fc1e2013-09-06 20:01:5168#include "ui/gfx/range/range.h"
[email protected]d353541f2012-05-03 22:45:4169#include "ui/surface/transport_dib.h"
initial.commit09911bf2008-07-26 23:55:2970
[email protected]484955942010-08-19 16:13:1871namespace IPC {
[email protected]586871b2014-07-22 17:05:1172class SyncMessageFilter;
[email protected]484955942010-08-19 16:13:1873}
74
[email protected]180ef242013-11-07 06:50:4675namespace blink {
skyostil529caa292016-08-10 17:44:5176namespace scheduler {
Yuta Kitamura39219b42018-04-06 10:28:1477class WebRenderWidgetSchedulingState;
skyostil529caa292016-08-10 17:44:5178}
[email protected]19193682014-04-03 15:01:4379struct WebDeviceEmulationParams;
paulmeyer6ef5a792016-11-08 20:33:5880class WebDragData;
lfgcaab5142016-02-26 19:06:5281class WebFrameWidget;
[email protected]41d86852012-11-07 12:23:2482class WebGestureEvent;
ekaramad2daaf672016-11-10 20:29:0183class WebInputMethodController;
kenrba7199832015-01-22 23:44:5984class WebLocalFrame;
[email protected]6a8ddba52010-09-05 04:38:0685class WebMouseEvent;
danakj19f3e512018-12-14 21:02:0586class WebPagePopup;
pwnallef669312017-01-07 01:17:2987} // namespace blink
[email protected]526476902011-10-06 20:34:0688
[email protected]586871b2014-07-22 17:05:1189namespace cc {
David Bokanc8e38d02018-10-08 21:56:0190struct ApplyViewportChangesArgs;
[email protected]586871b2014-07-22 17:05:1191class SwapPromise;
92}
[email protected]ba91a792013-02-06 09:48:2893
[email protected]db4fc1e2013-09-06 20:01:5194namespace gfx {
danakja2c9d0a92018-07-25 20:01:1895class ColorSpace;
[email protected]4de6d1692011-10-12 08:45:4496class Range;
97}
98
chongza8ba91fc2016-08-16 21:39:1799namespace ui {
100struct DidOverscrollParams;
101}
102
[email protected]e9ff79c2012-10-19 21:31:26103namespace content {
Saman Samid189e5dfd2017-12-20 22:55:31104class BrowserPlugin;
danakj6e3bf8012014-12-16 18:27:53105class CompositorDependencies;
[email protected]b2e4c70132013-10-03 02:07:51106class ExternalPopupMenu;
[email protected]586871b2014-07-22 17:05:11107class FrameSwapMessageQueue;
changwanf2a707b2015-10-30 08:22:16108class ImeEventGuard;
danakja6c10012018-07-06 14:25:36109class LayerTreeView;
dtapuska9ec1a912017-04-21 15:18:31110class MainThreadEventQueue;
ekaramad2a46d632016-07-19 13:33:09111class PepperPluginInstanceImpl;
[email protected]bffc8302014-01-23 20:52:16112class RenderFrameImpl;
[email protected]e3244ed2014-06-20 20:04:27113class RenderFrameProxy;
nickf7b38222016-11-22 21:59:35114class RenderViewImpl;
Albert J. Wong7bbf22d2018-12-20 00:27:27115class RenderWidgetDelegate;
mfomitchev2600fd7c2016-02-17 20:53:39116class RenderWidgetScreenMetricsEmulator;
[email protected]5b45ad42013-10-25 00:42:04117class ResizingModeSelector;
ekaramad330ba4232016-09-23 17:57:47118class TextInputClientObserver;
Dave Tapuska9db80842017-07-24 17:24:26119class WidgetInputHandlerManager;
[email protected]b2e4c70132013-10-03 02:07:51120struct ContextMenuParams;
Fady Samuel799e72192018-04-25 21:16:57121struct VisualProperties;
[email protected]e9ff79c2012-10-19 21:31:26122
initial.commit09911bf2008-07-26 23:55:29123// RenderWidget provides a communication bridge between a WebWidget and
124// a RenderWidgetHost, the latter of which lives in a different process.
dchengd96a27a2015-07-24 20:17:32125//
126// RenderWidget is used to implement:
127// - RenderViewImpl (deprecated)
128// - Fullscreen mode (RenderWidgetFullScreen)
129// - Popup "menus" (like the color chooser and date picker)
danakjbc6ba9d22018-11-17 04:03:41130// - Widgets for frames (the main frame, and subframes due to out-of-process
131// iframe support)
132//
133// Because the main frame RenderWidget is used to implement RenderViewImpl
134// (deprecated) it has a shared lifetime. But the RenderViewImpl may have
135// a proxy main frame which does not use a RenderWidget. Thus a RenderWidget
136// can be frozen, during the time in which we wish we could delete it but we
137// can't, and it should be (relatively.. it's a work in progress) unused during
138// that time. This does not apply to subframes, whose lifetimes are not tied to
139// the RenderViewImpl.
[email protected]f3112a52011-09-30 23:47:49140class CONTENT_EXPORT RenderWidget
[email protected]c47317e2012-06-20 22:35:31141 : public IPC::Listener,
142 public IPC::Sender,
danakj9a8a9cf2018-07-17 23:52:12143 public blink::WebWidgetClient,
Dave Tapuska1bdf1832017-07-07 18:07:19144 public mojom::Widget,
danakja6c10012018-07-06 14:25:36145 public LayerTreeViewDelegate,
fsamuel72464894f2015-12-15 06:59:31146 public RenderWidgetInputHandlerDelegate,
mfomitchev2600fd7c2016-02-17 20:53:39147 public RenderWidgetScreenMetricsEmulatorDelegate,
dtapuska9ec1a912017-04-21 15:18:31148 public base::RefCounted<RenderWidget>,
149 public MainThreadEventQueueClient {
initial.commit09911bf2008-07-26 23:55:29150 public:
danakjdf1ceb72018-07-18 20:02:25151 using ShowCallback =
152 base::OnceCallback<void(RenderWidget* widget_to_show,
153 blink::WebNavigationPolicy policy,
154 const gfx::Rect& initial_rect)>;
155
danakj53802692018-07-25 21:46:44156 // Time-To-First-Active-Paint(TTFAP) type
157 enum {
158 TTFAP_AFTER_PURGED,
159 TTFAP_5MIN_AFTER_BACKGROUNDED,
160 };
161
danakj6a816592018-09-25 18:30:56162 // An Init*() method must be called after creating a RenderWidget, which will
163 // make the RenderWidget self-referencing. Then it can be deleted by calling
164 // Close().
165 RenderWidget(int32_t widget_routing_id,
166 CompositorDependencies* compositor_deps,
danakj6a816592018-09-25 18:30:56167 const ScreenInfo& screen_info,
168 blink::WebDisplayMode display_mode,
danakj6dcbc5962018-11-16 16:45:42169 bool is_frozen,
danakj6a816592018-09-25 18:30:56170 bool hidden,
171 bool never_visible,
172 mojom::WidgetRequest widget_request = nullptr);
173
danakj25ec6e2b2018-09-26 17:01:31174 // Initialize a new RenderWidget for a popup. The |show_callback| is called
175 // when RenderWidget::Show() happens. This method increments the reference
176 // count on the RenderWidget, making it self-referencing, which can be
177 // released by calling Close().
178 void InitForPopup(ShowCallback show_callback,
179 blink::WebPagePopup* web_page_popup);
initial.commit09911bf2008-07-26 23:55:29180
danakj6a816592018-09-25 18:30:56181 // Initialize a new RenderWidget that will be attached to a RenderFrame (via
182 // the WebFrameWidget), for a frame that is a local root, but not the main
183 // frame. This method increments the reference count on the RenderWidget,
184 // making it self-referencing, which can be released by calling Close().
185 void InitForChildLocalRoot(blink::WebFrameWidget* web_frame_widget);
lfg1568d112016-08-30 16:06:29186
Albert J. Wong7bbf22d2018-12-20 00:27:27187 // Sets a delegate to handle certain RenderWidget operations that need an
188 // escape to the RenderView. Also take ownership until RenderWidget lifetime
189 // has been reassociated with the RenderFrame. This is only set on Widgets
190 // that are associated with the RenderView.
191 // TODO(ajwong): Do not have RenderWidget own the delegate.
192 void set_delegate(std::unique_ptr<RenderWidgetDelegate> delegate) {
193 DCHECK(!delegate_);
194 delegate_ = std::move(delegate);
danakj53802692018-07-25 21:46:44195 }
Albert J. Wong7bbf22d2018-12-20 00:27:27196
197 RenderWidgetDelegate* delegate() const { return delegate_.get(); }
danakj53802692018-07-25 21:46:44198
Albert J. Wongcb004632018-07-10 22:58:25199 // Returns the RenderWidget for the given routing ID.
200 static RenderWidget* FromRoutingID(int32_t routing_id);
201
dchengda9b4bb2015-07-20 20:58:08202 // Closes a RenderWidget that was created by |CreateForFrame|.
danakja2c9d0a92018-07-25 20:01:18203 void CloseForFrame();
[email protected]484955942010-08-19 16:13:18204
nick8331f8ad2016-11-15 20:42:45205 int32_t routing_id() const { return routing_id_; }
fsamuele8326c742016-01-12 00:49:39206
danakj6e3bf8012014-12-16 18:27:53207 CompositorDependencies* compositor_deps() const { return compositor_deps_; }
Ken Buchananed449bb2018-02-01 21:02:05208
209 // This can return nullptr while the RenderWidget is closing.
danakja2c9d0a92018-07-25 20:01:18210 blink::WebWidget* GetWebWidget() const;
ekaramad2daaf672016-11-10 20:29:01211
212 // Returns the current instance of WebInputMethodController which is to be
213 // used for IME related tasks. This instance corresponds to the one from
214 // focused frame and can be nullptr.
215 blink::WebInputMethodController* GetInputMethodController() const;
216
mfomitchev2600fd7c2016-02-17 20:53:39217 const gfx::Size& size() const { return size_; }
Christopher Cameron58089372018-03-08 23:11:13218 const gfx::Size& compositor_viewport_pixel_size() const {
Christopher Cameronaad15a0d2018-03-09 03:47:33219 return compositor_viewport_pixel_size_;
Christopher Cameron58089372018-03-08 23:11:13220 }
mikhail.pozdnyakovf2c902a2015-04-14 08:09:12221 bool is_fullscreen_granted() const { return is_fullscreen_granted_; }
mikhail.pozdnyakovc0e251b2015-04-15 06:51:12222 blink::WebDisplayMode display_mode() const { return display_mode_; }
[email protected]204f1df2012-01-04 20:21:13223 bool is_hidden() const { return is_hidden_; }
[email protected]4ee64622014-03-21 22:34:15224 // Temporary for debugging purposes...
225 bool closing() const { return closing_; }
pwnallef669312017-01-07 01:17:29226 bool has_host_context_menu_location() const {
[email protected]be1af0662014-07-29 19:55:51227 return has_host_context_menu_location_;
228 }
pwnallef669312017-01-07 01:17:29229 gfx::Point host_context_menu_location() const {
[email protected]be1af0662014-07-29 19:55:51230 return host_context_menu_location_;
[email protected]4ee64622014-03-21 22:34:15231 }
Ken Buchananb2c9e262018-03-10 16:53:31232 const gfx::Size& visible_viewport_size() const {
233 return visible_viewport_size_;
234 }
[email protected]589621b2010-09-23 22:01:07235
danakj53802692018-07-25 21:46:44236 ScreenInfo screen_info() const { return screen_info_; }
237 void set_screen_info(const ScreenInfo& info) { screen_info_ = info; }
avi40b5be7a2016-03-03 21:13:44238
danakj6dcbc5962018-11-16 16:45:42239 // Sets whether this RenderWidget should be moved into or out of a frozen
240 // state. This state is used for the RenderWidget attached to a RenderViewImpl
241 // for its main frame, when there is no local main frame present.
242 // In this case, the RenderWidget can't be deleted currently but should
243 // otherwise act as if it is dead. Only whitelisted new IPC messages will be
244 // sent, and it does no compositing. The process is free to exit when there
245 // are no other unfrozen (thawed) RenderWidgets.
246 void SetIsFrozen(bool is_frozen);
247 bool is_frozen() const { return is_frozen_; }
alexmos78c9c0d2016-10-14 18:57:03248
danakjf87460792018-12-04 20:14:22249 // When a RenderWidget is created, even if frozen, if we expect to unfreeze
250 // and use the RenderWidget imminently, then we want to pre-emptively start
251 // the process of getting the resources needed for the compositor. This helps
252 // to parallelize the critical path to first pixels with the loading process.
253 // This should only be called when the RenderWidget is frozen, otherwise it
254 // would be redundant at best. Non-frozen RenderWidgets will start to warmup
255 // immediately on their own.
256 void WarmupCompositor();
257 // If after calling WarmupCompositor() we can determine that the RenderWidget
258 // does not expect to be used shortly after all, call this to cancel the
259 // warmup process and release any unused resources that had been created by
260 // it.
261 void AbortWarmupCompositor();
262
danakj678f0252018-11-09 21:46:34263 // This is true once a Close IPC has been received. The actual action of
264 // closing must be done on another stack frame, in case the IPC receipt
265 // is in a nested message loop and will unwind back up to javascript (from
266 // plugins). So this will be true between those two things, to avoid work
267 // when the RenderWidget will be closed.
268 // Additionally, as an optimization, this is true after we know the renderer
269 // has asked the browser to close this RenderWidget.
270 //
271 // TODO(crbug.com/545684): Once RenderViewImpl and RenderWidget are split,
272 // attempt to combine two states so the shutdown logic is cleaner.
273 bool is_closing() const { return host_will_close_this_ || closing_; }
274
alexmos56567492016-09-13 00:52:46275 // Manage edit commands to be used for the next keyboard event.
276 const EditCommands& edit_commands() const { return edit_commands_; }
277 void SetEditCommandForNextKeyEvent(const std::string& name,
278 const std::string& value);
279 void ClearEditCommands();
280
[email protected]bffc8302014-01-23 20:52:16281 // Functions to track out-of-process frames for special notifications.
[email protected]e3244ed2014-06-20 20:04:27282 void RegisterRenderFrameProxy(RenderFrameProxy* proxy);
283 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy);
[email protected]bffc8302014-01-23 20:52:16284
[email protected]de3c5d82014-05-28 22:12:59285 // Functions to track all RenderFrame objects associated with this
286 // RenderWidget.
287 void RegisterRenderFrame(RenderFrameImpl* frame);
288 void UnregisterRenderFrame(RenderFrameImpl* frame);
289
Saman Samid189e5dfd2017-12-20 22:55:31290 // BrowserPlugins embedded by this RenderWidget register themselves here.
291 // These plugins need to be notified about changes to ScreenInfo.
292 void RegisterBrowserPlugin(BrowserPlugin* browser_plugin);
293 void UnregisterBrowserPlugin(BrowserPlugin* browser_plugin);
294
[email protected]c47317e2012-06-20 22:35:31295 // IPC::Listener
dcheng6d18e402014-10-21 12:32:52296 bool OnMessageReceived(const IPC::Message& msg) override;
initial.commit09911bf2008-07-26 23:55:29297
[email protected]c47317e2012-06-20 22:35:31298 // IPC::Sender
dcheng6d18e402014-10-21 12:32:52299 bool Send(IPC::Message* msg) override;
initial.commit09911bf2008-07-26 23:55:29300
danakja6c10012018-07-06 14:25:36301 // LayerTreeViewDelegate
David Bokanc8e38d02018-10-08 21:56:01302 void ApplyViewportChanges(const cc::ApplyViewportChangesArgs& args) override;
sahel1b47fda72017-03-28 17:03:07303 void RecordWheelAndTouchScrollingCount(bool has_scrolled_by_wheel,
304 bool has_scrolled_by_touch) override;
Sahel Sharify676580c2019-01-10 21:49:49305 void SendOverscrollEventFromImplSide(
306 const gfx::Vector2dF& overscroll_delta,
307 cc::ElementId scroll_latched_element_id) override;
308 void SendScrollEndEventFromImplSide(
309 cc::ElementId scroll_latched_element_id) override;
Daniel Cheng224569ee2018-04-25 05:45:06310 void BeginMainFrame(base::TimeTicks frame_time) override;
danakjc7afae52017-06-20 21:12:41311 void RequestNewLayerTreeFrameSink(
danakja6c10012018-07-06 14:25:36312 LayerTreeFrameSinkCallback callback) override;
fsamuel78f86e42016-01-20 04:10:23313 void DidCommitAndDrawCompositorFrame() override;
314 void DidCommitCompositorFrame() override;
315 void DidCompletePageScaleAnimation() override;
Stephen Chenneyd56b5382019-01-29 00:37:02316 void RecordStartOfFrameMetrics() override;
Stephen Chenney9879a5c2018-09-26 14:21:42317 void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) override;
Stephen Chenneyd56b5382019-01-29 00:37:02318 void UpdateVisualState() override;
fsamuel78f86e42016-01-20 04:10:23319 void WillBeginCompositorFrame() override;
Kent Tamura21d1de62018-12-10 04:45:20320 std::unique_ptr<cc::SwapPromise> RequestCopyOfOutputForWebTest(
Fady Samueldfecb7d2017-07-26 11:41:04321 std::unique_ptr<viz::CopyOutputRequest> request) override;
fsamuel78f86e42016-01-20 04:10:23322
fsamuel72464894f2015-12-15 06:59:31323 // RenderWidgetInputHandlerDelegate
324 void FocusChangeComplete() override;
Sandra Sunac5cdd832017-12-11 03:27:13325 void ObserveGestureEventAndResult(
326 const blink::WebGestureEvent& gesture_event,
327 const gfx::Vector2dF& unused_delta,
328 const cc::OverscrollBehavior& overscroll_behavior,
329 bool event_processed) override;
dtapuska1827dd22016-03-11 15:24:59330
fsamuel72464894f2015-12-15 06:59:31331 void OnDidHandleKeyEvent() override;
chongza8ba91fc2016-08-16 21:39:17332 void OnDidOverscroll(const ui::DidOverscrollParams& params) override;
fsamuele8326c742016-01-12 00:49:39333 void SetInputHandler(RenderWidgetInputHandler* input_handler) override;
changwan75e3b2072017-01-16 02:55:00334 void ShowVirtualKeyboard() override;
335 void UpdateTextInputState() override;
changwan62f57292017-02-17 08:28:25336 void ClearTextInputState() override;
fsamuel72464894f2015-12-15 06:59:31337 bool WillHandleGestureEvent(const blink::WebGestureEvent& event) override;
338 bool WillHandleMouseEvent(const blink::WebMouseEvent& event) override;
339
Scott Violet1098538e2017-10-05 19:23:33340 // RenderWidgetScreenMetricsEmulatorDelegate
Fady Samuel799e72192018-04-25 21:16:57341 void SynchronizeVisualProperties(
342 const VisualProperties& resize_params) override;
mfomitchev2600fd7c2016-02-17 20:53:39343 void SetScreenMetricsEmulationParameters(
344 bool enabled,
345 const blink::WebDeviceEmulationParams& params) override;
Albert J. Wong3c93c182018-09-27 17:29:43346 void SetScreenRects(const gfx::Rect& widget_screen_rect,
mfomitchev2600fd7c2016-02-17 20:53:39347 const gfx::Rect& window_screen_rect) override;
348
[email protected]180ef242013-11-07 06:50:46349 // blink::WebWidgetClient
danakj53f46b82018-12-11 20:55:55350 void ScheduleAnimation() override;
danakjefcb8432019-01-16 18:47:14351 void SetShowFPSCounter(bool show) override;
danakje691e852019-01-16 22:49:04352 void SetShowPaintRects(bool) override;
353 void SetShowDebugBorders(bool) override;
354 void SetShowScrollBottleneckRects(bool) override;
355 void SetShowHitTestBorders(bool) override;
Chris Harrelsond7ab99b2018-01-24 17:51:36356 void IntrinsicSizingInfoChanged(
357 const blink::WebIntrinsicSizingInfo&) override;
Blink Reformat1c4d759e2017-04-09 16:34:54358 void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override;
359 void DidChangeCursor(const blink::WebCursorInfo&) override;
aelias5971e47d2017-06-16 02:39:38360 void AutoscrollStart(const blink::WebFloatPoint& point) override;
361 void AutoscrollFling(const blink::WebFloatSize& velocity) override;
362 void AutoscrollEnd() override;
Blink Reformat1c4d759e2017-04-09 16:34:54363 void CloseWidgetSoon() override;
364 void Show(blink::WebNavigationPolicy) override;
365 blink::WebRect WindowRect() override;
366 blink::WebRect ViewRect() override;
367 void SetToolTipText(const blink::WebString& text,
avi5c77d212015-09-25 20:08:25368 blink::WebTextDirection hint) override;
Blink Reformat1c4d759e2017-04-09 16:34:54369 void SetWindowRect(const blink::WebRect&) override;
Blink Reformat1c4d759e2017-04-09 16:34:54370 void DidHandleGestureEvent(const blink::WebGestureEvent& event,
avi5c77d212015-09-25 20:08:25371 bool event_cancelled) override;
Blink Reformat1c4d759e2017-04-09 16:34:54372 void DidOverscroll(const blink::WebFloatSize& overscrollDelta,
bokane53a10f2016-04-13 23:48:31373 const blink::WebFloatSize& accumulatedOverscroll,
avi5c77d212015-09-25 20:08:25374 const blink::WebFloatPoint& position,
sunyunjiabbea8a92017-08-31 11:18:54375 const blink::WebFloatSize& velocity,
danakje819b622018-05-01 20:27:14376 const cc::OverscrollBehavior& behavior) override;
Blink Reformat1c4d759e2017-04-09 16:34:54377 void ShowVirtualKeyboardOnElementFocus() override;
378 void ConvertViewportToWindow(blink::WebRect* rect) override;
379 void ConvertWindowToViewport(blink::WebFloatRect* rect) override;
380 bool RequestPointerLock() override;
381 void RequestPointerUnlock() override;
382 bool IsPointerLocked() override;
Richard Li49fe04d2018-10-21 09:07:19383 void StartDragging(network::mojom::ReferrerPolicy policy,
paulmeyer6ef5a792016-11-08 20:33:58384 const blink::WebDragData& data,
385 blink::WebDragOperationsMask mask,
danakj0c75ad82018-07-10 19:50:12386 const SkBitmap& drag_image,
danakjef1735a2018-11-13 19:34:44387 const gfx::Point& image_offset) override;
danakj53802692018-07-25 21:46:44388 void SetTouchAction(cc::TouchAction touch_action) override;
389 void RequestUnbufferedInputEvents() override;
Navid Zolghadr8fdb6114e2018-08-29 19:00:54390 void HasPointerRawMoveEventHandlers(bool has_handlers) override;
danakj53802692018-07-25 21:46:44391 void HasTouchEventHandlers(bool has_handlers) override;
392 void SetNeedsLowLatencyInput(bool) override;
Pavel Feldman6708eefa2019-01-17 03:14:32393 void SetNeedsUnbufferedInputForDebugger(bool) override;
W. James MacLeand973a55b2018-11-29 21:39:13394 void AnimateDoubleTapZoomInMainFrame(const blink::WebPoint& point,
395 const blink::WebRect& bounds) override;
W. James MacLean5372eb72018-12-19 12:56:36396 void ZoomToFindInPageRectInMainFrame(
397 const blink::WebRect& rect_to_zoom) override;
[email protected]4873c7d2009-07-16 06:36:28398
fsamuel72464894f2015-12-15 06:59:31399 // Override point to obtain that the current input method state and caret
400 // position.
danakja2c9d0a92018-07-25 20:01:18401 ui::TextInputType GetTextInputType();
fsamuel72464894f2015-12-15 06:59:31402
danakj4b347212018-07-04 17:55:17403 static cc::LayerTreeSettings GenerateLayerTreeSettings(
404 CompositorDependencies* compositor_deps,
405 bool is_for_subframe,
406 const gfx::Size& initial_screen_size,
407 float initial_device_scale_factor);
danakj4b347212018-07-04 17:55:17408 static cc::ManagedMemoryPolicy GetGpuMemoryPolicy(
409 const cc::ManagedMemoryPolicy& policy,
410 const gfx::Size& initial_screen_size,
411 float initial_device_scale_factor);
412
danakja6c10012018-07-06 14:25:36413 LayerTreeView* layer_tree_view() const { return layer_tree_view_.get(); }
Dave Tapuska9db80842017-07-24 17:24:26414 WidgetInputHandlerManager* widget_input_handler_manager() {
415 return widget_input_handler_manager_.get();
416 }
fsamuel72464894f2015-12-15 06:59:31417 const RenderWidgetInputHandler& input_handler() const {
fsamuele8326c742016-01-12 00:49:39418 return *input_handler_;
fsamuel72464894f2015-12-15 06:59:31419 }
420
danakj53802692018-07-25 21:46:44421 void SetHandlingInputEvent(bool handling_input_event);
422
danakj2c1589f2019-01-25 23:35:07423 // Queues the IPC |message| to be sent to the browser, delaying sending until
424 // the next compositor frame submission. At that time they will be sent before
425 // any message from the compositor as part of submitting its frame. This is
426 // used for messages that need synchronization with the compositor, but in
427 // general you should use Send().
428 //
[email protected]586871b2014-07-22 17:05:11429 // This mechanism is not a drop-in replacement for IPC: messages sent this way
430 // will not be automatically available to BrowserMessageFilter, for example.
Sadrul Habib Chowdhury4e0335cf2018-07-31 20:08:49431 // FIFO ordering is preserved between messages enqueued.
[email protected]586871b2014-07-22 17:05:11432 //
433 // |msg| message to send, ownership of |msg| is transferred.
Sadrul Habib Chowdhury4e0335cf2018-07-31 20:08:49434 void QueueMessage(IPC::Message* msg);
[email protected]586871b2014-07-22 17:05:11435
changwanf2a707b2015-10-30 08:22:16436 // Handle start and finish of IME event guard.
437 void OnImeEventGuardStart(ImeEventGuard* guard);
438 void OnImeEventGuardFinish(ImeEventGuard* guard);
[email protected]66fca5bc2013-05-23 06:58:29439
danakj53802692018-07-25 21:46:44440 void ApplyEmulatedScreenMetricsForPopupWidget(RenderWidget* origin_widget);
[email protected]b2e4c70132013-10-03 02:07:51441
[email protected]2d6836f42014-07-02 17:25:31442 gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor);
[email protected]b2e4c70132013-10-03 02:07:51443
[email protected]7a4e2532013-12-02 21:30:02444 // Checks if the selection bounds have been changed. If they are changed,
445 // the new value will be sent to the browser process.
446 void UpdateSelectionBounds();
447
danakja2c9d0a92018-07-25 20:01:18448 void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end);
[email protected]e5e438d62014-03-27 21:47:16449
[email protected]a09d53ce2014-01-31 00:46:42450 void OnShowHostContextMenu(ContextMenuParams* params);
[email protected]7a4e2532013-12-02 21:30:02451
[email protected]7a4e2532013-12-02 21:30:02452 // Checks if the composition range or composition character bounds have been
453 // changed. If they are changed, the new value will be sent to the browser
yukawa5f21c6a2014-10-27 17:09:30454 // process. This method does nothing when the browser process is not able to
455 // handle composition range and composition character bounds.
nonafa291792016-08-10 02:36:18456 // If immediate_request is true, render sends the latest composition info to
457 // the browser even if the composition info is not changed.
458 void UpdateCompositionInfo(bool immediate_request);
[email protected]7a4e2532013-12-02 21:30:02459
danakja2c9d0a92018-07-25 20:01:18460 // Override point to obtain that the current composition character bounds.
461 // In the case of surrogate pairs, the character is treated as two characters:
462 // the bounds for first character is actual one, and the bounds for second
463 // character is zero width rectangle.
464 void GetCompositionCharacterBounds(std::vector<gfx::Rect>* character_bounds);
465
lfgb00fcad2016-07-14 14:16:33466 // Called when the Widget has changed size as a result of an auto-resize.
467 void DidAutoResize(const gfx::Size& new_size);
468
Albert J. Wongcb004632018-07-10 22:58:25469 void DidPresentForceDrawFrame(int snapshot_id,
470 const gfx::PresentationFeedback& feedback);
471
lfge0c2792ec2016-05-11 18:52:08472 // Indicates whether this widget has focus.
473 bool has_focus() const { return has_focus_; }
474
pwnallef669312017-01-07 01:17:29475 MouseLockDispatcher* mouse_lock_dispatcher() const {
lfgbee1e0a2016-06-08 21:24:21476 return mouse_lock_dispatcher_.get();
477 }
478
Fady Samuela863f152018-03-09 16:10:03479 // Returns the ScreenInfo exposed to Blink. In device emulation, this
480 // may not match the compositor ScreenInfo.
481 const ScreenInfo& GetWebScreenInfo() const;
Christopher Camerone9a30c12018-03-07 08:23:38482
Fady Samuela863f152018-03-09 16:10:03483 // When emulated, this returns the original (non-emulated) ScreenInfo.
484 const ScreenInfo& GetOriginalScreenInfo() const;
lfg1f9011c2016-08-17 21:18:42485
paulmeyer90f6c31d2016-11-12 00:17:59486 // Helper to convert |point| using ConvertWindowToViewport().
Ella Ge80a52dce2017-11-15 18:01:52487 gfx::PointF ConvertWindowPointToViewport(const gfx::PointF& point);
paulmeyer90f6c31d2016-11-12 00:17:59488 gfx::Point ConvertWindowPointToViewport(const gfx::Point& point);
kenrb5d78b842017-03-06 21:06:01489 uint32_t GetContentSourceId();
Saman Samif7731342018-01-24 22:18:44490 void DidNavigate();
kenrb5d78b842017-03-06 21:06:01491
Fady Samuele62be402018-03-29 03:19:53492 bool auto_resize_mode() const { return auto_resize_mode_; }
493
Fady Samuele62be402018-03-29 03:19:53494 const gfx::Size& min_size_for_auto_resize() const {
495 return min_size_for_auto_resize_;
496 }
497
498 const gfx::Size& max_size_for_auto_resize() const {
499 return max_size_for_auto_resize_;
500 }
Vladimir Levin98d76dad2018-04-21 00:21:29501
502 uint32_t capture_sequence_number() const {
503 return last_capture_sequence_number_;
504 }
505
dtapuska9ec1a912017-04-21 15:18:31506 // MainThreadEventQueueClient overrides.
danakj327a4fe2019-01-26 00:00:35507 bool HandleInputEvent(const blink::WebCoalescedInputEvent& input_event,
508 const ui::LatencyInfo& latency_info,
509 HandledEventCallback callback) override;
dtapuska9ec1a912017-04-21 15:18:31510 void SetNeedsMainFrame() override;
511
Xianzhu Wangf02017ac2018-10-17 01:47:33512 viz::FrameSinkId GetFrameSinkIdAtPoint(const gfx::PointF& point,
Ken Buchanan44d7e2f2018-08-23 14:18:05513 gfx::PointF* local_point);
Navid Zolghadr0d86e5f2017-10-23 18:09:22514
danakj327a4fe2019-01-26 00:00:35515 // Widget mojom overrides.
Dave Tapuska139a72f2017-09-06 21:57:03516 void SetupWidgetInputHandler(mojom::WidgetInputHandlerRequest request,
517 mojom::WidgetInputHandlerHostPtr host) override;
dtapuska9ec1a912017-04-21 15:18:31518
dtapuska9d46ef7d2017-05-26 19:06:06519 scoped_refptr<MainThreadEventQueue> GetInputEventQueue();
520
Albert J. Wongcb004632018-07-10 22:58:25521 void OnSetActive(bool active);
danakja2c9d0a92018-07-25 20:01:18522 void OnSetFocus(bool enable);
Dave Tapuska9db80842017-07-24 17:24:26523 void OnMouseCaptureLost();
524 void OnCursorVisibilityChange(bool is_visible);
525 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands);
526 void OnImeSetComposition(
527 const base::string16& text,
Ryan Landay9e42fd742017-08-12 01:59:11528 const std::vector<blink::WebImeTextSpan>& ime_text_spans,
Dave Tapuska9db80842017-07-24 17:24:26529 const gfx::Range& replacement_range,
530 int selection_start,
531 int selection_end);
Ryan Landay9e42fd742017-08-12 01:59:11532 void OnImeCommitText(const base::string16& text,
533 const std::vector<blink::WebImeTextSpan>& ime_text_spans,
534 const gfx::Range& replacement_range,
535 int relative_cursor_pos);
Dave Tapuska9db80842017-07-24 17:24:26536 void OnImeFinishComposingText(bool keep_selection);
537
danakja2c9d0a92018-07-25 20:01:18538 // This does the actual focus change, but is called in more situations than
539 // just as an IPC message.
540 void SetFocus(bool enable);
541
Dave Tapuska9db80842017-07-24 17:24:26542 // Called by the browser process to update text input state.
543 void OnRequestTextInputStateUpdate();
544
545 // Called by the browser process to update the cursor and composition
Dave Tapuska04bc5ee92018-04-17 19:03:31546 // information by sending WidgetInputHandlerHost::ImeCompositionRangeChanged.
547 // If |immediate_request| is true, an IPC is sent back with current state.
Dave Tapuska9db80842017-07-24 17:24:26548 // When |monitor_update| is true, then RenderWidget will send the updates
549 // in each compositor frame when there are changes. Outside of compositor
550 // frame updates, a change in text selection might also lead to an update for
551 // composition info (when in monitor mode).
552 void OnRequestCompositionUpdates(bool immediate_request,
553 bool monitor_updates);
Dave Tapuska485aca92017-08-08 00:47:58554 void SetWidgetBinding(mojom::WidgetRequest request);
Dave Tapuska9db80842017-07-24 17:24:26555
Ken Buchanan94c0beb62018-06-22 19:56:24556 void SetMouseCapture(bool capture);
557
danakj53802692018-07-25 21:46:44558 void SetWindowScreenRect(const gfx::Rect& window_screen_rect);
Takashi SAKAMOTO870f6262017-08-22 04:08:27559
Fady Samuelca9ecb72018-05-05 05:59:27560 bool IsSurfaceSynchronizationEnabled() const;
561
W. James MacLean2a90bff2018-11-05 20:52:47562 void PageScaleFactorChanged(float page_scale_factor);
563
danakj53802692018-07-25 21:46:44564 void UseSynchronousResizeModeForTesting(bool enable);
danakja2c9d0a92018-07-25 20:01:18565 void SetDeviceScaleFactorForTesting(float factor);
566 void SetDeviceColorSpaceForTesting(const gfx::ColorSpace& color_space);
567 void SetWindowRectSynchronouslyForTesting(const gfx::Rect& new_window_rect);
568 void EnableAutoResizeForTesting(const gfx::Size& min_size,
569 const gfx::Size& max_size);
570 void DisableAutoResizeForTesting(const gfx::Size& new_size);
571
Albert J. Wong7bbf22d2018-12-20 00:27:27572 // Update the WebView's device scale factor.
573 // TODO(ajwong): This should be moved into RenderView.
574 void UpdateWebViewWithDeviceScaleFactor();
Saman Sami50d1e0c2018-03-13 20:03:49575
Albert J. Wong7bbf22d2018-12-20 00:27:27576 // RenderWidget IPC message handler that can be overridden by subclasses.
577 virtual void OnSynchronizeVisualProperties(const VisualProperties& params);
initial.commit09911bf2008-07-26 23:55:29578
nick4df698d82016-11-11 20:39:23579 // Called by Create() functions and subclasses to finish initialization.
danakj53802692018-07-25 21:46:44580 // |show_callback| will be invoked once WebWidgetClient::Show() occurs, and
581 // should be null if Show() won't be triggered for this widget.
Scott Violetae08f332018-07-27 17:37:23582 void Init(ShowCallback show_callback, blink::WebWidget* web_widget);
[email protected]484955942010-08-19 16:13:18583
Albert J. Wong7bbf22d2018-12-20 00:27:27584 base::WeakPtr<RenderWidget> AsWeakPtr();
585
586 protected:
587 ~RenderWidget() override;
danakj53802692018-07-25 21:46:44588
589 // Close the underlying WebWidget and stop the compositor.
590 virtual void Close();
591
592 // Notify subclasses that we initiated the paint operation.
593 virtual void DidInitiatePaint() {}
594
danakj53802692018-07-25 21:46:44595 private:
596 // Friend RefCounted so that the dtor can be non-public. Using this class
597 // without ref-counting is an error.
598 friend class base::RefCounted<RenderWidget>;
599
600 // TODO(nasko): Temporarily friend RenderFrameImpl for WasSwappedOut(),
601 // while we move frame specific code away from RenderViewImpl/RenderWidget.
602 friend class RenderFrameImpl;
603
604 // For unit tests.
605 friend class InteractiveRenderWidget;
606 friend class PopupRenderWidget;
607 friend class QueueMessageSwapPromiseTest;
608 friend class RenderWidgetTest;
Albert J. Wong7bbf22d2018-12-20 00:27:27609 friend class RenderViewImplTest; // TODO(ajwong): Can this be removed?
danakj53802692018-07-25 21:46:44610 FRIEND_TEST_ALL_PREFIXES(RenderWidgetPopupUnittest, EmulatingPopupRect);
danakja2c9d0a92018-07-25 20:01:18611
Hajime Hoshi315a61f2018-08-14 17:27:28612 static scoped_refptr<base::SingleThreadTaskRunner> GetCleanupTaskRunner();
613
danakjde8b7482018-11-15 23:45:02614 // Creates the compositor, but leaves it in a stopped state, where it will
615 // not set up IPC channels or begin trying to produce frames until started
616 // via StartCompositor().
danakj17216f4d2018-10-16 22:57:32617 LayerTreeView* InitializeLayerTreeView();
618
danakjde8b7482018-11-15 23:45:02619 // Initiates the compositor to set up IPC channels and begin its scheduler.
620 void StartCompositor();
621 // Pauses the compositor's scheduler and tears down its IPC channels.
622 void StopCompositor();
623
[email protected]2533ce12009-05-09 00:02:24624 void DoDeferredClose();
dchengda9b4bb2015-07-20 20:58:08625
bokanc63441c2016-04-27 15:49:12626 gfx::Size GetSizeForWebWidget() const;
danakja2c9d0a92018-07-25 20:01:18627 void ResizeWebWidget();
bokanc63441c2016-04-27 15:49:12628
Ken Buchananed449bb2018-02-01 21:02:05629 // Just Close the WebWidget, in cases where the Close() will be deferred.
630 // It is safe to call this multiple times, which happens in the case of
631 // frame widgets beings closed, since subsequent calls are ignored.
632 void CloseWebWidget();
633
thakis18e426412017-03-15 12:06:37634#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
Albert J. Wong7bbf22d2018-12-20 00:27:27635 void SetExternalPopupOriginAdjustmentsForEmulation(ExternalPopupMenu* popup);
[email protected]53907862014-03-25 15:42:40636#endif
[email protected]61e2b3cc2012-03-02 16:13:34637
danakj53802692018-07-25 21:46:44638 // RenderWidget IPC message handlers.
nzolghadr5d8596502017-01-23 22:59:35639 void OnHandleInputEvent(
640 const blink::WebInputEvent* event,
641 const std::vector<const blink::WebInputEvent*>& coalesced_events,
642 const ui::LatencyInfo& latency_info,
643 InputEventDispatchType dispatch_type);
naskoc288745f2015-05-01 22:54:21644 void OnClose();
[email protected]fc4404d2012-11-07 19:53:30645 void OnCreatingNewAck();
dgozman9260b0a12015-03-16 13:45:20646 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params);
647 void OnDisableDeviceEmulation();
danakja2c9d0a92018-07-25 20:01:18648 void OnWasHidden();
Saman Samie61e5c032018-11-05 22:11:44649 void OnWasShown(base::TimeTicks show_request_timestamp, bool was_evicted);
avi1023d012015-12-25 02:39:14650 void OnCreateVideoAck(int32_t video_id);
651 void OnUpdateVideoAck(int32_t video_id);
Avi Drissman014dec72018-06-07 02:34:01652 void OnRequestSetBoundsAck();
Albert J. Wongcb004632018-07-10 22:58:25653 void OnForceRedraw(int snapshot_id);
danakja2c9d0a92018-07-25 20:01:18654 void OnShowContextMenu(ui::MenuSourceType source_type,
655 const gfx::Point& location);
oshimad5279032015-12-16 18:22:33656
[email protected]180ef242013-11-07 06:50:46657 void OnSetTextDirection(blink::WebTextDirection direction);
[email protected]872ae5b2011-05-26 20:20:50658 void OnGetFPS();
Albert J. Wong3c93c182018-09-27 17:29:43659 void OnUpdateScreenRects(const gfx::Rect& widget_screen_rect,
[email protected]80ad8622012-11-07 16:33:03660 const gfx::Rect& window_screen_rect);
Ken Buchananb2c9e262018-03-10 16:53:31661 void OnSetViewportIntersection(const gfx::Rect& viewport_intersection,
Stefan Zager54e25832018-08-14 22:15:31662 const gfx::Rect& compositor_visible_rect,
663 bool occluded_or_obscured);
kenrb04323782017-06-23 01:23:32664 void OnSetIsInert(bool);
sunxd540a9962018-05-24 22:51:06665 void OnSetInheritedEffectiveTouchAction(cc::TouchAction touch_action);
Ken Buchanan8a319fb2017-11-15 18:37:12666 void OnUpdateRenderThrottlingStatus(bool is_throttled,
667 bool subtree_throttled);
paulmeyer90f6c31d2016-11-12 00:17:59668 void OnDragTargetDragEnter(
669 const std::vector<DropData::Metadata>& drop_meta_data,
Ella Ge80a52dce2017-11-15 18:01:52670 const gfx::PointF& client_pt,
671 const gfx::PointF& screen_pt,
paulmeyer90f6c31d2016-11-12 00:17:59672 blink::WebDragOperationsMask operations_allowed,
673 int key_modifiers);
Ella Ge80a52dce2017-11-15 18:01:52674 void OnDragTargetDragOver(const gfx::PointF& client_pt,
675 const gfx::PointF& screen_pt,
paulmeyer90f6c31d2016-11-12 00:17:59676 blink::WebDragOperationsMask operations_allowed,
677 int key_modifiers);
Ella Ge80a52dce2017-11-15 18:01:52678 void OnDragTargetDragLeave(const gfx::PointF& client_point,
679 const gfx::PointF& screen_point);
paulmeyer90f6c31d2016-11-12 00:17:59680 void OnDragTargetDrop(const DropData& drop_data,
Ella Ge80a52dce2017-11-15 18:01:52681 const gfx::PointF& client_pt,
682 const gfx::PointF& screen_pt,
paulmeyer90f6c31d2016-11-12 00:17:59683 int key_modifiers);
Ella Ge80a52dce2017-11-15 18:01:52684 void OnDragSourceEnded(const gfx::PointF& client_point,
685 const gfx::PointF& screen_point,
paulmeyer8fc8ea92016-11-15 05:12:21686 blink::WebDragOperation drag_operation);
687 void OnDragSourceSystemDragEnded();
lfg8d649cc2017-04-28 18:04:30688 void OnOrientationChange();
danakj53802692018-07-25 21:46:44689 void OnWaitNextFrameForTests(int routing_id);
[email protected]65225772011-05-12 21:10:24690
[email protected]bee16aab2009-08-26 15:55:03691 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
692 // use this method so that we can properly inform the RenderThread of our
693 // state.
694 void SetHidden(bool hidden);
695
danakjf9284772019-01-23 18:29:14696 // Sets the fullscreen state for the WebView.
697 // TODO(danakj): This is currently located on RenderWidget but is a page/view
698 // state, and should move to RenderView.
699 void SetIsFullscreen(bool fullscreen);
[email protected]2b624c562011-10-27 22:58:26700
Ken Buchananb2c9e262018-03-10 16:53:31701 // Returns a rect that the compositor needs to raster. For a main frame this
Darwin Huang2c485f8e2018-10-12 21:06:00702 // is always the entire viewport, but for out-of-process iframes this can be
Ken Buchananb2c9e262018-03-10 16:53:31703 // constrained to limit overdraw.
704 gfx::Rect ViewportVisibleRect();
705
[email protected]586871b2014-07-22 17:05:11706 // QueueMessage implementation extracted into a static method for easy
707 // testing.
dchengcedca5612016-04-09 01:40:15708 static std::unique_ptr<cc::SwapPromise> QueueMessageImpl(
[email protected]586871b2014-07-22 17:05:11709 IPC::Message* msg,
[email protected]586871b2014-07-22 17:05:11710 FrameSwapMessageQueue* frame_swap_message_queue,
711 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter,
[email protected]586871b2014-07-22 17:05:11712 int source_frame_number);
713
[email protected]88dbe32f2013-06-20 23:31:36714 // Returns the range of the text that is being composed or the selection if
715 // the composition does not exist.
danakja2c9d0a92018-07-25 20:01:18716 void GetCompositionRange(gfx::Range* range);
[email protected]88dbe32f2013-06-20 23:31:36717
[email protected]58b48a0d2012-06-13 07:01:35718 // Returns true if the composition range or composition character bounds
719 // should be sent to the browser process.
720 bool ShouldUpdateCompositionInfo(
[email protected]db4fc1e2013-09-06 20:01:51721 const gfx::Range& range,
[email protected]58b48a0d2012-06-13 07:01:35722 const std::vector<gfx::Rect>& bounds);
723
[email protected]ad26ef42011-06-17 07:59:45724 // Override point to obtain that the current input method state about
725 // composition text.
danakja2c9d0a92018-07-25 20:01:18726 bool CanComposeInline();
[email protected]56ea1a62011-05-30 07:05:57727
[email protected]2533ce12009-05-09 00:02:24728 // Set the pending window rect.
729 // Because the real render_widget is hosted in another process, there is
730 // a time period where we may have set a new window rect which has not yet
731 // been processed by the browser. So we maintain a pending window rect
732 // size. If JS code sets the WindowRect, and then immediately calls
733 // GetWindowRect() we'll use this pending window rect as the size.
[email protected]180ef242013-11-07 06:50:46734 void SetPendingWindowRect(const blink::WebRect& r);
[email protected]2533ce12009-05-09 00:02:24735
danakj53802692018-07-25 21:46:44736 // TODO(ekaramad): This method should not be confused with its RenderView
737 // variant, GetWebFrameWidget(). Currently Cast and AndroidWebview's
738 // ContentRendererClients are the only users of the public variant. The public
739 // method will eventually be removed from RenderView and uses of the method
740 // will obtain WebFrameWidget from WebLocalFrame.
741 // Returns the WebFrameWidget associated with this RenderWidget if any.
742 // Returns nullptr if GetWebWidget() returns nullptr or returns a WebWidget
743 // that is not a WebFrameWidget. A WebFrameWidget only makes sense when there
744 // a local root associated with it. RenderWidgetFullscreenPepper and a swapped
745 // out RenderWidgets are amongst the cases where this method returns nullptr.
746 blink::WebFrameWidget* GetFrameWidget() const;
[email protected]ce6689f2013-03-29 12:52:55747
danakj53802692018-07-25 21:46:44748 // Applies/Removes the DevTools device emulation transformation to/from a
749 // window rect.
750 void ScreenRectToEmulatedIfNeeded(blink::WebRect* window_rect) const;
751 void EmulatedToScreenRectIfNeeded(blink::WebRect* window_rect) const;
Dave Tapuskadfe486c12017-06-09 16:53:13752
danakj53802692018-07-25 21:46:44753 void UpdateSurfaceAndScreenInfo(
Fady Samuel1c1ad3692018-11-06 23:28:40754 const viz::LocalSurfaceIdAllocation& new_local_surface_id_allocation,
danakj53802692018-07-25 21:46:44755 const gfx::Size& new_compositor_viewport_pixel_size,
756 const ScreenInfo& new_screen_info);
[email protected]5d0bbdfa92013-12-10 00:35:51757
Kent Tamura21d1de62018-12-10 04:45:20758 // Used to force the size of a window when running web tests.
danakj53802692018-07-25 21:46:44759 void SetWindowRectSynchronously(const gfx::Rect& new_window_rect);
760
761 void UpdateCaptureSequenceNumber(uint32_t capture_sequence_number);
762
763 // A variant of Send but is fatal if it fails. The browser may
764 // be waiting for this IPC Message and if the send fails the browser will
765 // be left in a state waiting for something that never comes. And if it
766 // never comes then it may later determine this is a hung renderer; so
767 // instead fail right away.
768 void SendOrCrash(IPC::Message* msg);
769
770 // Determines whether or not RenderWidget should process IME events from the
771 // browser. It always returns true unless there is no WebFrameWidget to
772 // handle the event, or there is no page focus.
773 bool ShouldHandleImeEvents() const;
774
775 void UpdateTextInputStateInternal(bool show_virtual_keyboard,
776 bool reply_to_request);
777
778 gfx::ColorSpace GetRasterColorSpace() const;
779
danakj53802692018-07-25 21:46:44780 void UpdateZoom(double zoom_level);
781
782#if BUILDFLAG(ENABLE_PLUGINS)
783 // Returns the focused pepper plugin, if any, inside the WebWidget. That is
784 // the pepper plugin which is focused inside a frame which belongs to the
785 // local root associated with this RenderWidget.
786 PepperPluginInstanceImpl* GetFocusedPepperPluginInsideWidget();
787#endif
788 void RecordTimeToFirstActivePaint();
789
danakj53802692018-07-25 21:46:44790 // This method returns the WebLocalFrame which is currently focused and
791 // belongs to the frame tree associated with this RenderWidget.
792 blink::WebLocalFrame* GetFocusedWebLocalFrameInWidget() const;
lfg43e08e62016-02-03 18:51:37793
danakjf87460792018-12-04 20:14:22794 // Called with the resulting frame sink from WarmupCompositor() since frame
795 // sink creation can be asynchronous.
796 void OnReplyForWarmupCompositor(std::unique_ptr<cc::LayerTreeFrameSink> sink);
797
798 // Common code shared to execute the creation of a LayerTreeFrameSink, shared
799 // by the warmup and standard request paths. Callers should verify they really
800 // want to do this before calling it as this method does no verification.
801 void DoRequestNewLayerTreeFrameSink(LayerTreeFrameSinkCallback callback);
802
danakj89ae4532018-12-12 22:52:55803 // Whether this widget is for a frame. This excludes widgets that are not for
804 // a frame (eg popups, pepper), but includes both the main frame
Albert J. Wong7bbf22d2018-12-20 00:27:27805 // (via delegate_) and subframes (via for_child_local_root_frame_).
806 bool for_frame() const { return delegate_ || for_child_local_root_frame_; }
danakj89ae4532018-12-12 22:52:55807
initial.commit09911bf2008-07-26 23:55:29808 // Routing ID that allows us to communicate to the parent browser process
nick8331f8ad2016-11-15 20:42:45809 // RenderWidgetHost.
810 const int32_t routing_id_;
initial.commit09911bf2008-07-26 23:55:29811
danakj6e3bf8012014-12-16 18:27:53812 // Dependencies for initializing a compositor, including flags for optional
813 // features.
dcheng35d31c112015-07-22 00:17:36814 CompositorDependencies* const compositor_deps_;
danakj6e3bf8012014-12-16 18:27:53815
lfg8ff33912016-09-13 20:59:21816 // Use GetWebWidget() instead of using webwidget_internal_ directly.
[email protected]c5b3b5e2009-02-13 06:41:11817 // We are responsible for destroying this object via its Close method.
[email protected]4ee64622014-03-21 22:34:15818 // May be NULL when the window is closing.
lfg8ff33912016-09-13 20:59:21819 blink::WebWidget* webwidget_internal_;
initial.commit09911bf2008-07-26 23:55:29820
Albert J. Wong7bbf22d2018-12-20 00:27:27821 // The delegate for this object which is just a RenderViewImpl.
822 std::unique_ptr<RenderWidgetDelegate> delegate_;
avi40b5be7a2016-03-03 21:13:44823
[email protected]8926c602013-01-23 05:32:06824 // This is lazily constructed and must not outlive webwidget_.
danakja6c10012018-07-06 14:25:36825 std::unique_ptr<LayerTreeView> layer_tree_view_;
[email protected]8926c602013-01-23 05:32:06826
bokanc007c3a2015-02-03 07:15:56827 // The rect where this view should be initially shown.
828 gfx::Rect initial_rect_;
initial.commit09911bf2008-07-26 23:55:29829
danakja2c9d0a92018-07-25 20:01:18830 base::Optional<float> device_scale_factor_for_testing_;
831
Christopher Cameronbe7ecea2018-02-27 00:47:19832 // The size of the RenderWidget in DIPs. This may differ from
Christopher Cameronaad15a0d2018-03-09 03:47:33833 // |compositor_viewport_pixel_size_| in the following (and possibly other)
834 // cases: * On Android, for top and bottom controls * On OOPIF, due to
835 // rounding
initial.commit09911bf2008-07-26 23:55:29836 gfx::Size size_;
837
Christopher Cameronbe7ecea2018-02-27 00:47:19838 // The size of the compositor's surface in pixels.
Christopher Cameronaad15a0d2018-03-09 03:47:33839 gfx::Size compositor_viewport_pixel_size_;
[email protected]60d47ac2013-03-01 23:42:44840
Christopher Cameronbe7ecea2018-02-27 00:47:19841 // The size of the visible viewport in pixels.
[email protected]bb6378fe2014-04-28 21:19:44842 gfx::Size visible_viewport_size_;
843
[email protected]847a2582013-03-09 02:29:51844 // Whether the WebWidget is in auto resize mode, which is used for example
845 // by extension popups.
846 bool auto_resize_mode_;
847
Fady Samuele62be402018-03-29 03:19:53848 // The minimum size to use for auto-resize.
849 gfx::Size min_size_for_auto_resize_;
850
851 // The maximum size to use for auto-resize.
852 gfx::Size max_size_for_auto_resize_;
853
initial.commit09911bf2008-07-26 23:55:29854 // Indicates that we shouldn't bother generated paint events.
855 bool is_hidden_;
856
[email protected]7912e822014-04-16 02:37:03857 // Indicates that we are never visible, so never produce graphical output.
sievers71c62dd52015-10-07 01:44:39858 const bool compositor_never_visible_;
[email protected]7912e822014-04-16 02:37:03859
mikhail.pozdnyakovf2c902a2015-04-14 08:09:12860 // Indicates whether tab-initiated fullscreen was granted.
861 bool is_fullscreen_granted_;
[email protected]ee41e7d22011-10-14 19:34:09862
mikhail.pozdnyakovc0e251b2015-04-15 06:51:12863 // Indicates the display mode.
864 blink::WebDisplayMode display_mode_;
865
changwanf2a707b2015-10-30 08:22:16866 // It is possible that one ImeEventGuard is nested inside another
867 // ImeEventGuard. We keep track of the outermost one, and update it as needed.
868 ImeEventGuard* ime_event_guard_;
[email protected]e8f775f2013-02-14 21:00:50869
initial.commit09911bf2008-07-26 23:55:29870 // True if we have requested this widget be closed. No more messages will
871 // be sent, except for a Close.
872 bool closing_;
873
[email protected]aeeedad2014-08-22 18:16:22874 // True if it is known that the host is in the process of being shut down.
danakj5c5269b2018-11-06 00:39:11875 bool host_will_close_this_;
[email protected]aeeedad2014-08-22 18:16:22876
danakj6dcbc5962018-11-16 16:45:42877 // A RenderWidget is frozen if it is the RenderWidget attached to the
878 // RenderViewImpl for its main frame, but there is a proxy main frame in
879 // RenderViewImpl's frame tree. Since proxy frames do not have content they
880 // do not need a RenderWidget.
danakjbc6ba9d22018-11-17 04:03:41881 // This flag should never be used for RenderWidgets attached to subframes, as
882 // those RenderWidgets are able to be created/deleted along with the frames,
883 // unlike the main frame RenderWidget (for now).
danakj6dcbc5962018-11-16 16:45:42884 // TODO(419087): In this case the RenderWidget should not exist at all as
885 // it has nothing to display, but since we can't destroy it without destroying
886 // the RenderViewImpl, we freeze it instead.
887 bool is_frozen_;
[email protected]992db4c2011-05-12 15:37:15888
[email protected]5b739cb2012-08-21 20:35:21889 // Stores information about the current text input.
[email protected]180ef242013-11-07 06:50:46890 blink::WebTextInputInfo text_input_info_;
[email protected]5b739cb2012-08-21 20:35:21891
dglazkov97b6c2b2016-10-25 17:35:55892 // Stores the current text input type of |webwidget_|.
893 ui::TextInputType text_input_type_;
894
[email protected]b256eca2013-07-11 10:57:40895 // Stores the current text input mode of |webwidget_|.
896 ui::TextInputMode text_input_mode_;
897
shuchen82ce8c52014-10-23 01:55:20898 // Stores the current text input flags of |webwidget_|.
899 int text_input_flags_;
900
AJITH KUMAR V041c0b02017-08-08 10:39:20901 // Indicates whether currently focused input field has next/previous focusable
902 // form input field.
903 int next_previous_flags_;
904
[email protected]86ba5fcb2013-09-04 00:36:53905 // Stores the current type of composition text rendering of |webwidget_|.
906 bool can_compose_inline_;
907
[email protected]e99ef6f2011-10-16 01:13:00908 // Stores the current selection bounds.
[email protected]7c8873e2013-02-05 08:03:01909 gfx::Rect selection_focus_rect_;
910 gfx::Rect selection_anchor_rect_;
initial.commit09911bf2008-07-26 23:55:29911
[email protected]58b48a0d2012-06-13 07:01:35912 // Stores the current composition character bounds.
913 std::vector<gfx::Rect> composition_character_bounds_;
914
915 // Stores the current composition range.
[email protected]db4fc1e2013-09-06 20:01:51916 gfx::Range composition_range_;
[email protected]58b48a0d2012-06-13 07:01:35917
[email protected]80ad8622012-11-07 16:33:03918 // While we are waiting for the browser to update window sizes, we track the
919 // pending size temporarily.
[email protected]2533ce12009-05-09 00:02:24920 int pending_window_rect_count_;
lfg0140a452016-07-19 19:15:05921 gfx::Rect pending_window_rect_;
[email protected]2533ce12009-05-09 00:02:24922
[email protected]80ad8622012-11-07 16:33:03923 // The screen rects of the view and the window that contains it.
Albert J. Wong3c93c182018-09-27 17:29:43924 gfx::Rect widget_screen_rect_;
[email protected]80ad8622012-11-07 16:33:03925 gfx::Rect window_screen_rect_;
926
Dave Tapuska9db80842017-07-24 17:24:26927 scoped_refptr<WidgetInputHandlerManager> widget_input_handler_manager_;
928
dchengcedca5612016-04-09 01:40:15929 std::unique_ptr<RenderWidgetInputHandler> input_handler_;
[email protected]12fbad812009-09-01 18:21:24930
[email protected]fd847792013-10-24 17:12:35931 // The time spent in input handlers this frame. Used to throttle input acks.
932 base::TimeDelta total_input_handling_time_this_frame_;
933
[email protected]842f10652012-06-06 01:54:04934 // Properties of the screen hosting this RenderWidget instance.
ccameron2f451532016-09-07 21:49:27935 ScreenInfo screen_info_;
[email protected]842f10652012-06-06 01:54:04936
nonafa291792016-08-10 02:36:18937 // True if the IME requests updated composition info.
938 bool monitor_composition_info_;
939
dchengcedca5612016-04-09 01:40:15940 std::unique_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_;
[email protected]b2e4c70132013-10-03 02:07:51941
942 // Popups may be displaced when screen metrics emulation is enabled.
943 // These values are used to properly adjust popup position.
danakj2ef31b82015-10-21 18:18:02944 gfx::Point popup_view_origin_for_emulation_;
945 gfx::Point popup_screen_origin_for_emulation_;
[email protected]b2e4c70132013-10-03 02:07:51946 float popup_origin_scale_for_emulation_;
947
[email protected]586871b2014-07-22 17:05:11948 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
dchengcedca5612016-04-09 01:40:15949 std::unique_ptr<ResizingModeSelector> resizing_mode_selector_;
[email protected]5b45ad42013-10-25 00:42:04950
[email protected]e3244ed2014-06-20 20:04:27951 // Lists of RenderFrameProxy objects that need to be notified of
952 // compositing-related events (e.g. DidCommitCompositorFrame).
Trent Apteda250ec3ab2018-08-19 08:52:19953 base::ObserverList<RenderFrameProxy>::Unchecked render_frame_proxies_;
[email protected]bffc8302014-01-23 20:52:16954
[email protected]de3c5d82014-05-28 22:12:59955 // A list of RenderFrames associated with this RenderWidget. Notifications
956 // are sent to each frame in the list for events such as changing
957 // visibility state for example.
Trent Apteda250ec3ab2018-08-19 08:52:19958 base::ObserverList<RenderFrameImpl>::Unchecked render_frames_;
[email protected]de3c5d82014-05-28 22:12:59959
Trent Apteda250ec3ab2018-08-19 08:52:19960 base::ObserverList<BrowserPlugin>::Unchecked browser_plugins_;
Saman Samid189e5dfd2017-12-20 22:55:31961
[email protected]be1af0662014-07-29 19:55:51962 bool has_host_context_menu_location_;
963 gfx::Point host_context_menu_location_;
[email protected]a09d53ce2014-01-31 00:46:42964
Yuta Kitamura39219b42018-04-06 10:28:14965 std::unique_ptr<blink::scheduler::WebRenderWidgetSchedulingState>
alexclarke7fa93942015-10-21 15:37:11966 render_widget_scheduling_state_;
967
lfgbee1e0a2016-06-08 21:24:21968 // Mouse Lock dispatcher attached to this view.
969 std::unique_ptr<RenderWidgetMouseLockDispatcher> mouse_lock_dispatcher_;
970
971 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
972 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
973
danakjf87460792018-12-04 20:14:22974 // Set to true while a warmup is in progress. Set to false if the warmup is
975 // completed or aborted. If aborted, the reply callback is also cancelled by
976 // invalidating the |warmup_weak_ptr_factory_|.
977 bool warmup_frame_sink_request_pending_ = false;
978 // Set after warmup completes without being aborted. This frame sink will be
979 // returned on the next request for a frame sink instead of creating a new
980 // one.
981 std::unique_ptr<cc::LayerTreeFrameSink> warmup_frame_sink_;
982 // Set if a request for a frame sink arrives while a warmup is in progress.
983 // Then this stores the request to be satisfied once the warmup completes.
984 LayerTreeFrameSinkCallback after_warmup_callback_;
985
Fady Samuel1c1ad3692018-11-06 23:28:40986 viz::LocalSurfaceIdAllocation local_surface_id_allocation_from_parent_;
Fady Samuelda839bb2018-03-26 17:34:48987
lfge0c2792ec2016-05-11 18:52:08988 // Indicates whether this widget has focus.
989 bool has_focus_;
990
danakj6dcbc5962018-11-16 16:45:42991 // Whether this widget is for a child local root frame. This excludes widgets
992 // that are not for a frame (eg popups) and excludes the widget for the main
993 // frame (which is attached to the RenderViewImpl).
994 bool for_child_local_root_frame_;
Nicolas Pena75a35d662018-04-05 20:13:44995
nickf7b38222016-11-22 21:59:35996 // A callback into the creator/opener of this widget, to be executed when
danakjdf1ceb72018-07-18 20:02:25997 // WebWidgetClient::Show() occurs.
nickf7b38222016-11-22 21:59:35998 ShowCallback show_callback_;
999
ekaramad330ba4232016-09-23 17:57:471000#if defined(OS_MACOSX)
1001 // Responds to IPCs from TextInputClientMac regarding getting string at given
1002 // position or range as well as finding character index at a given position.
1003 std::unique_ptr<TextInputClientObserver> text_input_client_observer_;
1004#endif
1005
alexmos56567492016-09-13 00:52:461006 // Stores edit commands associated to the next key event.
1007 // Will be cleared as soon as the next key event is processed.
1008 EditCommands edit_commands_;
1009
paulmeyer6ef5a792016-11-08 20:33:581010 // This field stores drag/drop related info for the event that is currently
1011 // being handled. If the current event results in starting a drag/drop
1012 // session, this info is sent to the browser along with other drag/drop info.
1013 DragEventSourceInfo possible_drag_event_info_;
1014
Takashi SAKAMOTO870f6262017-08-22 04:08:271015 bool first_update_visual_state_after_hidden_;
tasakb95dbb50c2017-02-08 18:07:501016 base::TimeTicks was_shown_time_;
1017
danakja2c9d0a92018-07-25 20:01:181018 // Whether or not Blink's viewport size should be shrunk by the height of the
1019 // URL-bar.
1020 bool browser_controls_shrink_blink_size_ = false;
1021 // The height of the browser top controls.
1022 float top_controls_height_ = 0.f;
1023 // The height of the browser bottom controls.
1024 float bottom_controls_height_ = 0.f;
1025
danakj0246bba02019-01-23 23:12:271026 // The last seen page scale factor, which comes from the main frame and is
1027 // propagated through the RenderWidget tree. This value is passed to any new
1028 // child RenderWidget.
W. James MacLean2a90bff2018-11-05 20:52:471029 float page_scale_factor_from_mainframe_ = 1.f;
1030
kenrb5d78b842017-03-06 21:06:011031 // This is initialized to zero and is incremented on each non-same-page
1032 // navigation commit by RenderFrameImpl. At that time it is sent to the
1033 // compositor so that it can tag compositor frames, and RenderFrameImpl is
1034 // responsible for sending it to the browser process to be used to match
1035 // each compositor frame to the most recent page navigation before it was
1036 // generated.
1037 // This only applies to main frames, and is not touched for subframe
1038 // RenderWidgets, where there is no concern around displaying unloaded
1039 // content.
1040 // TODO(kenrb, fsamuel): This should be removed when SurfaceIDs can be used
1041 // to replace it. See https://crbug.com/695579.
1042 uint32_t current_content_source_id_;
1043
dtapuska9ec1a912017-04-21 15:18:311044 scoped_refptr<MainThreadEventQueue> input_event_queue_;
1045
Dave Tapuska1bdf1832017-07-07 18:07:191046 mojo::Binding<mojom::Widget> widget_binding_;
Hajime Hoshiabb3c8f2017-12-04 18:41:391047
Ken Buchananb2c9e262018-03-10 16:53:311048 gfx::Rect compositor_visible_rect_;
1049
W. James MacLean662d5382018-03-29 18:33:081050 // Different consumers in the browser process makes different assumptions, so
1051 // must always send the first IPC regardless of value.
1052 base::Optional<bool> has_touch_handlers_;
1053
Vladimir Levin98d76dad2018-04-21 00:21:291054 uint32_t last_capture_sequence_number_ = 0u;
1055
danakjf87460792018-12-04 20:14:221056 // Used to generate a callback for the reply when making the warmup frame
1057 // sink, and to cancel that callback if the warmup is aborted.
1058 base::WeakPtrFactory<RenderWidget> warmup_weak_ptr_factory_;
1059
wjmaclean1d970622017-01-21 22:28:241060 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
1061
[email protected]05d478752009-04-08 23:38:161062 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
initial.commit09911bf2008-07-26 23:55:291063};
1064
[email protected]e9ff79c2012-10-19 21:31:261065} // namespace content
1066
[email protected]2cff0052011-03-18 16:51:441067#endif // CONTENT_RENDERER_RENDER_WIDGET_H_