[email protected] | 9f4f332 | 2012-01-18 22:29:56 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | 2cff005 | 2011-03-18 16:51:44 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 | #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 7 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | #include <stdint.h> |
| 10 | |
[email protected] | 0e241b4b | 2012-08-18 09:06:27 | [diff] [blame] | 11 | #include <map> |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 12 | #include <memory> |
xlai | 180af79 | 2016-08-26 22:07:42 | [diff] [blame] | 13 | #include <queue> |
pwnall | ef66931 | 2017-01-07 01:17:29 | [diff] [blame] | 14 | #include <string> |
| 15 | #include <vector> |
[email protected] | 010ea08a | 2009-10-11 20:21:32 | [diff] [blame] | 16 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 17 | #include "base/callback.h" |
Fady Samuel | 1ee6fb5c | 2018-02-16 03:27:46 | [diff] [blame] | 18 | #include "base/cancelable_callback.h" |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 19 | #include "base/compiler_specific.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 20 | #include "base/macros.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 21 | #include "base/memory/ref_counted.h" |
wjmaclean | 1d97062 | 2017-01-21 22:28:24 | [diff] [blame] | 22 | #include "base/memory/weak_ptr.h" |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 23 | #include "base/observer_list.h" |
Gabriel Charette | 1452023 | 2018-04-30 23:27:22 | [diff] [blame] | 24 | #include "base/single_thread_task_runner.h" |
[email protected] | abb52216 | 2013-06-28 01:54:16 | [diff] [blame] | 25 | #include "base/time/time.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 26 | #include "build/build_config.h" |
Sandra Sun | ac5cdd83 | 2017-12-11 03:27:13 | [diff] [blame] | 27 | #include "cc/input/overscroll_behavior.h" |
xidachen | fa0199e7 | 2017-05-11 11:34:26 | [diff] [blame] | 28 | #include "cc/input/touch_action.h" |
danakj | 4b34721 | 2018-07-04 17:55:17 | [diff] [blame] | 29 | #include "cc/trees/layer_tree_settings.h" |
| 30 | #include "cc/trees/managed_memory_policy.h" |
Fady Samuel | 644df1d | 2017-07-13 01:13:02 | [diff] [blame] | 31 | #include "components/viz/common/surfaces/local_surface_id.h" |
Scott Violet | c78fef73 | 2018-03-06 17:42:53 | [diff] [blame] | 32 | #include "content/common/buildflags.h" |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 33 | #include "content/common/content_export.h" |
[email protected] | c2809346d | 2014-03-20 00:11:03 | [diff] [blame] | 34 | #include "content/common/cursors/webcursor.h" |
paulmeyer | 6ef5a79 | 2016-11-08 20:33:58 | [diff] [blame] | 35 | #include "content/common/drag_event_source_info.h" |
alexmos | 5656749 | 2016-09-13 00:52:46 | [diff] [blame] | 36 | #include "content/common/edit_command.h" |
Dave Tapuska | 1bdf183 | 2017-07-07 18:07:19 | [diff] [blame] | 37 | #include "content/common/widget.mojom.h" |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 38 | #include "content/public/common/drop_data.h" |
ccameron | 2f45153 | 2016-09-07 21:49:27 | [diff] [blame] | 39 | #include "content/public/common/screen_info.h" |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 40 | #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delegate.h" |
danakj | a6c1001 | 2018-07-06 14:25:36 | [diff] [blame] | 41 | #include "content/renderer/gpu/layer_tree_view_delegate.h" |
dtapuska | 9ec1a91 | 2017-04-21 15:18:31 | [diff] [blame] | 42 | #include "content/renderer/input/main_thread_event_queue.h" |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 43 | #include "content/renderer/input/render_widget_input_handler.h" |
| 44 | #include "content/renderer/input/render_widget_input_handler_delegate.h" |
lfg | bee1e0a | 2016-06-08 21:24:21 | [diff] [blame] | 45 | #include "content/renderer/mouse_lock_dispatcher.h" |
| 46 | #include "content/renderer/render_widget_mouse_lock_dispatcher.h" |
[email protected] | 4f86bdb | 2012-11-10 19:11:19 | [diff] [blame] | 47 | #include "ipc/ipc_listener.h" |
nick | 4df698d8 | 2016-11-11 20:39:23 | [diff] [blame] | 48 | #include "ipc/ipc_message.h" |
[email protected] | 4f86bdb | 2012-11-10 19:11:19 | [diff] [blame] | 49 | #include "ipc/ipc_sender.h" |
Dave Tapuska | 1bdf183 | 2017-07-07 18:07:19 | [diff] [blame] | 50 | #include "mojo/public/cpp/bindings/binding.h" |
Scott Violet | 02e38b9 | 2018-03-27 23:42:14 | [diff] [blame] | 51 | #include "ppapi/buildflags/buildflags.h" |
Dmitry Gozman | 88ca5a99 | 2018-05-18 00:13:33 | [diff] [blame] | 52 | #include "third_party/blink/public/common/manifest/web_display_mode.h" |
Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 53 | #include "third_party/blink/public/platform/web_input_event.h" |
| 54 | #include "third_party/blink/public/platform/web_rect.h" |
| 55 | #include "third_party/blink/public/platform/web_referrer_policy.h" |
| 56 | #include "third_party/blink/public/platform/web_text_input_info.h" |
| 57 | #include "third_party/blink/public/web/web_ime_text_span.h" |
| 58 | #include "third_party/blink/public/web/web_popup_type.h" |
| 59 | #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] | b256eca | 2013-07-11 10:57:40 | [diff] [blame] | 62 | #include "ui/base/ime/text_input_mode.h" |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 63 | #include "ui/base/ime/text_input_type.h" |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 64 | #include "ui/base/ui_base_types.h" |
tfarina | 93bfa91 | 2014-12-05 14:23:15 | [diff] [blame] | 65 | #include "ui/gfx/geometry/rect.h" |
tfarina | 93bfa91 | 2014-12-05 14:23:15 | [diff] [blame] | 66 | #include "ui/gfx/geometry/vector2d_f.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 67 | #include "ui/gfx/native_widget_types.h" |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 68 | #include "ui/gfx/range/range.h" |
[email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 69 | #include "ui/surface/transport_dib.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 70 | |
danakj | 870925d | 2016-05-03 20:07:38 | [diff] [blame] | 71 | class GURL; |
| 72 | |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 73 | namespace IPC { |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 74 | class SyncMessageFilter; |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 75 | } |
| 76 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 77 | namespace blink { |
skyostil | 529caa29 | 2016-08-10 17:44:51 | [diff] [blame] | 78 | namespace scheduler { |
Yuta Kitamura | 39219b4 | 2018-04-06 10:28:14 | [diff] [blame] | 79 | class WebRenderWidgetSchedulingState; |
skyostil | 529caa29 | 2016-08-10 17:44:51 | [diff] [blame] | 80 | } |
[email protected] | 1919368 | 2014-04-03 15:01:43 | [diff] [blame] | 81 | struct WebDeviceEmulationParams; |
paulmeyer | 6ef5a79 | 2016-11-08 20:33:58 | [diff] [blame] | 82 | class WebDragData; |
lfg | caab514 | 2016-02-26 19:06:52 | [diff] [blame] | 83 | class WebFrameWidget; |
[email protected] | 41d8685 | 2012-11-07 12:23:24 | [diff] [blame] | 84 | class WebGestureEvent; |
ekaramad | 2daaf67 | 2016-11-10 20:29:01 | [diff] [blame] | 85 | class WebInputMethodController; |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 86 | class WebLocalFrame; |
[email protected] | 6a8ddba5 | 2010-09-05 04:38:06 | [diff] [blame] | 87 | class WebMouseEvent; |
donnd | a070f3c | 2015-01-16 19:54:11 | [diff] [blame] | 88 | struct WebPoint; |
pwnall | ef66931 | 2017-01-07 01:17:29 | [diff] [blame] | 89 | } // namespace blink |
[email protected] | 52647690 | 2011-10-06 20:34:06 | [diff] [blame] | 90 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 91 | namespace cc { |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 92 | class SwapPromise; |
| 93 | } |
[email protected] | ba91a79 | 2013-02-06 09:48:28 | [diff] [blame] | 94 | |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 95 | namespace gfx { |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 96 | class ColorSpace; |
[email protected] | 4de6d169 | 2011-10-12 08:45:44 | [diff] [blame] | 97 | class Range; |
| 98 | } |
| 99 | |
chongz | a8ba91fc | 2016-08-16 21:39:17 | [diff] [blame] | 100 | namespace ui { |
| 101 | struct DidOverscrollParams; |
| 102 | } |
| 103 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 104 | namespace content { |
Saman Sami | d189e5dfd | 2017-12-20 22:55:31 | [diff] [blame] | 105 | class BrowserPlugin; |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 106 | class CompositorDependencies; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 107 | class ExternalPopupMenu; |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 108 | class FrameSwapMessageQueue; |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 109 | class IdleUserDetector; |
changwan | f2a707b | 2015-10-30 08:22:16 | [diff] [blame] | 110 | class ImeEventGuard; |
danakj | a6c1001 | 2018-07-06 14:25:36 | [diff] [blame] | 111 | class LayerTreeView; |
dtapuska | 9ec1a91 | 2017-04-21 15:18:31 | [diff] [blame] | 112 | class MainThreadEventQueue; |
ekaramad | 2a46d63 | 2016-07-19 13:33:09 | [diff] [blame] | 113 | class PepperPluginInstanceImpl; |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 114 | class RenderFrameImpl; |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 115 | class RenderFrameProxy; |
nick | f7b3822 | 2016-11-22 21:59:35 | [diff] [blame] | 116 | class RenderViewImpl; |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 117 | class RenderWidgetOwnerDelegate; |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 118 | class RenderWidgetScreenMetricsEmulator; |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 119 | class ResizingModeSelector; |
ekaramad | 330ba423 | 2016-09-23 17:57:47 | [diff] [blame] | 120 | class TextInputClientObserver; |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 121 | class WidgetInputHandlerManager; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 122 | struct ContextMenuParams; |
Fady Samuel | 799e7219 | 2018-04-25 21:16:57 | [diff] [blame] | 123 | struct VisualProperties; |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 124 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 125 | // RenderWidget provides a communication bridge between a WebWidget and |
| 126 | // a RenderWidgetHost, the latter of which lives in a different process. |
dcheng | d96a27a | 2015-07-24 20:17:32 | [diff] [blame] | 127 | // |
| 128 | // RenderWidget is used to implement: |
| 129 | // - RenderViewImpl (deprecated) |
| 130 | // - Fullscreen mode (RenderWidgetFullScreen) |
| 131 | // - Popup "menus" (like the color chooser and date picker) |
| 132 | // - Widgets for frames (for out-of-process iframe support) |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 133 | class CONTENT_EXPORT RenderWidget |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 134 | : public IPC::Listener, |
| 135 | public IPC::Sender, |
danakj | 9a8a9cf | 2018-07-17 23:52:12 | [diff] [blame] | 136 | public blink::WebWidgetClient, |
Dave Tapuska | 1bdf183 | 2017-07-07 18:07:19 | [diff] [blame] | 137 | public mojom::Widget, |
danakj | a6c1001 | 2018-07-06 14:25:36 | [diff] [blame] | 138 | public LayerTreeViewDelegate, |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 139 | public RenderWidgetInputHandlerDelegate, |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 140 | public RenderWidgetScreenMetricsEmulatorDelegate, |
dtapuska | 9ec1a91 | 2017-04-21 15:18:31 | [diff] [blame] | 141 | public base::RefCounted<RenderWidget>, |
| 142 | public MainThreadEventQueueClient { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 143 | public: |
danakj | df1ceb7 | 2018-07-18 20:02:25 | [diff] [blame] | 144 | using ShowCallback = |
| 145 | base::OnceCallback<void(RenderWidget* widget_to_show, |
| 146 | blink::WebNavigationPolicy policy, |
| 147 | const gfx::Rect& initial_rect)>; |
| 148 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 149 | // Time-To-First-Active-Paint(TTFAP) type |
| 150 | enum { |
| 151 | TTFAP_AFTER_PURGED, |
| 152 | TTFAP_5MIN_AFTER_BACKGROUNDED, |
| 153 | }; |
| 154 | |
nick | f7b3822 | 2016-11-22 21:59:35 | [diff] [blame] | 155 | // Creates a new RenderWidget for a popup. |opener| is the RenderView that |
| 156 | // this widget lives inside. |
Hajime Hoshi | 315a61f | 2018-08-14 17:27:28 | [diff] [blame] | 157 | static RenderWidget* CreateForPopup(RenderViewImpl* opener, |
| 158 | CompositorDependencies* compositor_deps, |
| 159 | blink::WebPopupType popup_type, |
| 160 | const ScreenInfo& screen_info); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 161 | |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 162 | // Creates a new RenderWidget that will be attached to a RenderFrame. |
nick | 4df698d8 | 2016-11-11 20:39:23 | [diff] [blame] | 163 | static RenderWidget* CreateForFrame(int widget_routing_id, |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 164 | bool hidden, |
ccameron | 2f45153 | 2016-09-07 21:49:27 | [diff] [blame] | 165 | const ScreenInfo& screen_info, |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 166 | CompositorDependencies* compositor_deps, |
| 167 | blink::WebLocalFrame* frame); |
| 168 | |
lfg | 1568d11 | 2016-08-30 16:06:29 | [diff] [blame] | 169 | // Used by content_layouttest_support to hook into the creation of |
| 170 | // RenderWidgets. |
danakj | 73dd303 | 2018-07-28 17:49:53 | [diff] [blame] | 171 | using CreateRenderWidgetFunction = |
| 172 | RenderWidget* (*)(int32_t, |
| 173 | CompositorDependencies*, |
| 174 | blink::WebPopupType, |
| 175 | const ScreenInfo&, |
| 176 | blink::WebDisplayMode display_mode, |
| 177 | bool, |
| 178 | bool, |
| 179 | bool); |
lfg | 1568d11 | 2016-08-30 16:06:29 | [diff] [blame] | 180 | using RenderWidgetInitializedCallback = void (*)(RenderWidget*); |
| 181 | static void InstallCreateHook( |
| 182 | CreateRenderWidgetFunction create_render_widget, |
| 183 | RenderWidgetInitializedCallback render_widget_initialized_callback); |
| 184 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 185 | void set_owner_delegate(RenderWidgetOwnerDelegate* owner_delegate) { |
| 186 | DCHECK(!owner_delegate_); |
| 187 | owner_delegate_ = owner_delegate; |
| 188 | } |
| 189 | RenderWidgetOwnerDelegate* owner_delegate() const { return owner_delegate_; } |
| 190 | |
Albert J. Wong | cb00463 | 2018-07-10 22:58:25 | [diff] [blame] | 191 | // Returns the RenderWidget for the given routing ID. |
| 192 | static RenderWidget* FromRoutingID(int32_t routing_id); |
| 193 | |
dcheng | da9b4bb | 2015-07-20 20:58:08 | [diff] [blame] | 194 | // Closes a RenderWidget that was created by |CreateForFrame|. |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 195 | void CloseForFrame(); |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 196 | |
nick | 8331f8ad | 2016-11-15 20:42:45 | [diff] [blame] | 197 | int32_t routing_id() const { return routing_id_; } |
fsamuel | e8326c74 | 2016-01-12 00:49:39 | [diff] [blame] | 198 | |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 199 | CompositorDependencies* compositor_deps() const { return compositor_deps_; } |
Ken Buchanan | ed449bb | 2018-02-01 21:02:05 | [diff] [blame] | 200 | |
| 201 | // This can return nullptr while the RenderWidget is closing. |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 202 | blink::WebWidget* GetWebWidget() const; |
ekaramad | 2daaf67 | 2016-11-10 20:29:01 | [diff] [blame] | 203 | |
| 204 | // Returns the current instance of WebInputMethodController which is to be |
| 205 | // used for IME related tasks. This instance corresponds to the one from |
| 206 | // focused frame and can be nullptr. |
| 207 | blink::WebInputMethodController* GetInputMethodController() const; |
| 208 | |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 209 | const gfx::Size& size() const { return size_; } |
Christopher Cameron | 5808937 | 2018-03-08 23:11:13 | [diff] [blame] | 210 | const gfx::Size& compositor_viewport_pixel_size() const { |
Christopher Cameron | aad15a0d | 2018-03-09 03:47:33 | [diff] [blame] | 211 | return compositor_viewport_pixel_size_; |
Christopher Cameron | 5808937 | 2018-03-08 23:11:13 | [diff] [blame] | 212 | } |
mikhail.pozdnyakov | f2c902a | 2015-04-14 08:09:12 | [diff] [blame] | 213 | bool is_fullscreen_granted() const { return is_fullscreen_granted_; } |
mikhail.pozdnyakov | c0e251b | 2015-04-15 06:51:12 | [diff] [blame] | 214 | blink::WebDisplayMode display_mode() const { return display_mode_; } |
[email protected] | 204f1df | 2012-01-04 20:21:13 | [diff] [blame] | 215 | bool is_hidden() const { return is_hidden_; } |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 216 | // Temporary for debugging purposes... |
| 217 | bool closing() const { return closing_; } |
pwnall | ef66931 | 2017-01-07 01:17:29 | [diff] [blame] | 218 | bool has_host_context_menu_location() const { |
[email protected] | be1af066 | 2014-07-29 19:55:51 | [diff] [blame] | 219 | return has_host_context_menu_location_; |
| 220 | } |
pwnall | ef66931 | 2017-01-07 01:17:29 | [diff] [blame] | 221 | gfx::Point host_context_menu_location() const { |
[email protected] | be1af066 | 2014-07-29 19:55:51 | [diff] [blame] | 222 | return host_context_menu_location_; |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 223 | } |
Ken Buchanan | b2c9e26 | 2018-03-10 16:53:31 | [diff] [blame] | 224 | const gfx::Size& visible_viewport_size() const { |
| 225 | return visible_viewport_size_; |
| 226 | } |
[email protected] | 589621b | 2010-09-23 22:01:07 | [diff] [blame] | 227 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 228 | ScreenInfo screen_info() const { return screen_info_; } |
| 229 | void set_screen_info(const ScreenInfo& info) { screen_info_ = info; } |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 230 | |
alexmos | 78c9c0d | 2016-10-14 18:57:03 | [diff] [blame] | 231 | // Sets whether this RenderWidget has been swapped out to be displayed by |
| 232 | // a RenderWidget in a different process. If so, no new IPC messages will be |
| 233 | // sent (only ACKs) and the process is free to exit when there are no other |
| 234 | // active RenderWidgets. |
| 235 | void SetSwappedOut(bool is_swapped_out); |
pwnall | ef66931 | 2017-01-07 01:17:29 | [diff] [blame] | 236 | bool is_swapped_out() const { return is_swapped_out_; } |
alexmos | 78c9c0d | 2016-10-14 18:57:03 | [diff] [blame] | 237 | |
alexmos | 5656749 | 2016-09-13 00:52:46 | [diff] [blame] | 238 | // Manage edit commands to be used for the next keyboard event. |
| 239 | const EditCommands& edit_commands() const { return edit_commands_; } |
| 240 | void SetEditCommandForNextKeyEvent(const std::string& name, |
| 241 | const std::string& value); |
| 242 | void ClearEditCommands(); |
| 243 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 244 | // Functions to track out-of-process frames for special notifications. |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 245 | void RegisterRenderFrameProxy(RenderFrameProxy* proxy); |
| 246 | void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 247 | |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 248 | // Functions to track all RenderFrame objects associated with this |
| 249 | // RenderWidget. |
| 250 | void RegisterRenderFrame(RenderFrameImpl* frame); |
| 251 | void UnregisterRenderFrame(RenderFrameImpl* frame); |
| 252 | |
Saman Sami | d189e5dfd | 2017-12-20 22:55:31 | [diff] [blame] | 253 | // BrowserPlugins embedded by this RenderWidget register themselves here. |
| 254 | // These plugins need to be notified about changes to ScreenInfo. |
| 255 | void RegisterBrowserPlugin(BrowserPlugin* browser_plugin); |
| 256 | void UnregisterBrowserPlugin(BrowserPlugin* browser_plugin); |
| 257 | |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 258 | // IPC::Listener |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 259 | bool OnMessageReceived(const IPC::Message& msg) override; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 260 | |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 261 | // IPC::Sender |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 262 | bool Send(IPC::Message* msg) override; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 263 | |
danakj | a6c1001 | 2018-07-06 14:25:36 | [diff] [blame] | 264 | // LayerTreeViewDelegate |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 265 | void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, |
| 266 | const gfx::Vector2dF& outer_delta, |
| 267 | const gfx::Vector2dF& elastic_overscroll_delta, |
| 268 | float page_scale, |
| 269 | float top_controls_delta) override; |
sahel | 1b47fda7 | 2017-03-28 17:03:07 | [diff] [blame] | 270 | void RecordWheelAndTouchScrollingCount(bool has_scrolled_by_wheel, |
| 271 | bool has_scrolled_by_touch) override; |
Daniel Cheng | 224569ee | 2018-04-25 05:45:06 | [diff] [blame] | 272 | void BeginMainFrame(base::TimeTicks frame_time) override; |
danakj | c7afae5 | 2017-06-20 21:12:41 | [diff] [blame] | 273 | void RequestNewLayerTreeFrameSink( |
danakj | a6c1001 | 2018-07-06 14:25:36 | [diff] [blame] | 274 | LayerTreeFrameSinkCallback callback) override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 275 | void DidCommitAndDrawCompositorFrame() override; |
| 276 | void DidCommitCompositorFrame() override; |
| 277 | void DidCompletePageScaleAnimation() override; |
danakj | 6c872fc0 | 2016-10-22 04:29:49 | [diff] [blame] | 278 | void DidReceiveCompositorFrameAck() override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 279 | bool IsClosing() const override; |
danakj | 53eccbc | 2016-03-02 22:51:07 | [diff] [blame] | 280 | void RequestScheduleAnimation() override; |
Eric Seckler | 8af8c0e5 | 2018-01-17 23:45:53 | [diff] [blame] | 281 | void UpdateVisualState(VisualStateUpdate requested_update) override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 282 | void WillBeginCompositorFrame() override; |
jbroman | 6ccbc7d47 | 2016-07-27 04:45:41 | [diff] [blame] | 283 | std::unique_ptr<cc::SwapPromise> RequestCopyOfOutputForLayoutTest( |
Fady Samuel | dfecb7d | 2017-07-26 11:41:04 | [diff] [blame] | 284 | std::unique_ptr<viz::CopyOutputRequest> request) override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 285 | |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 286 | // RenderWidgetInputHandlerDelegate |
| 287 | void FocusChangeComplete() override; |
Sandra Sun | ac5cdd83 | 2017-12-11 03:27:13 | [diff] [blame] | 288 | void ObserveGestureEventAndResult( |
| 289 | const blink::WebGestureEvent& gesture_event, |
| 290 | const gfx::Vector2dF& unused_delta, |
| 291 | const cc::OverscrollBehavior& overscroll_behavior, |
| 292 | bool event_processed) override; |
dtapuska | 1827dd2 | 2016-03-11 15:24:59 | [diff] [blame] | 293 | |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 294 | void OnDidHandleKeyEvent() override; |
chongz | a8ba91fc | 2016-08-16 21:39:17 | [diff] [blame] | 295 | void OnDidOverscroll(const ui::DidOverscrollParams& params) override; |
fsamuel | e8326c74 | 2016-01-12 00:49:39 | [diff] [blame] | 296 | void SetInputHandler(RenderWidgetInputHandler* input_handler) override; |
changwan | 75e3b207 | 2017-01-16 02:55:00 | [diff] [blame] | 297 | void ShowVirtualKeyboard() override; |
| 298 | void UpdateTextInputState() override; |
changwan | 62f5729 | 2017-02-17 08:28:25 | [diff] [blame] | 299 | void ClearTextInputState() override; |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 300 | bool WillHandleGestureEvent(const blink::WebGestureEvent& event) override; |
| 301 | bool WillHandleMouseEvent(const blink::WebMouseEvent& event) override; |
| 302 | |
Scott Violet | 1098538e | 2017-10-05 19:23:33 | [diff] [blame] | 303 | // RenderWidgetScreenMetricsEmulatorDelegate |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 304 | void Redraw() override; |
Fady Samuel | 799e7219 | 2018-04-25 21:16:57 | [diff] [blame] | 305 | void SynchronizeVisualProperties( |
| 306 | const VisualProperties& resize_params) override; |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 307 | void SetScreenMetricsEmulationParameters( |
| 308 | bool enabled, |
| 309 | const blink::WebDeviceEmulationParams& params) override; |
| 310 | void SetScreenRects(const gfx::Rect& view_screen_rect, |
| 311 | const gfx::Rect& window_screen_rect) override; |
| 312 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 313 | // blink::WebWidgetClient |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 314 | blink::WebLayerTreeView* InitializeLayerTreeView() override; |
Chris Harrelson | d7ab99b | 2018-01-24 17:51:36 | [diff] [blame] | 315 | void IntrinsicSizingInfoChanged( |
| 316 | const blink::WebIntrinsicSizingInfo&) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 317 | void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override; |
| 318 | void DidChangeCursor(const blink::WebCursorInfo&) override; |
aelias | 5971e47d | 2017-06-16 02:39:38 | [diff] [blame] | 319 | void AutoscrollStart(const blink::WebFloatPoint& point) override; |
| 320 | void AutoscrollFling(const blink::WebFloatSize& velocity) override; |
| 321 | void AutoscrollEnd() override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 322 | void CloseWidgetSoon() override; |
| 323 | void Show(blink::WebNavigationPolicy) override; |
| 324 | blink::WebRect WindowRect() override; |
| 325 | blink::WebRect ViewRect() override; |
| 326 | void SetToolTipText(const blink::WebString& text, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 327 | blink::WebTextDirection hint) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 328 | void SetWindowRect(const blink::WebRect&) override; |
| 329 | blink::WebScreenInfo GetScreenInfo() override; |
| 330 | void DidHandleGestureEvent(const blink::WebGestureEvent& event, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 331 | bool event_cancelled) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 332 | void DidOverscroll(const blink::WebFloatSize& overscrollDelta, |
bokan | e53a10f | 2016-04-13 23:48:31 | [diff] [blame] | 333 | const blink::WebFloatSize& accumulatedOverscroll, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 334 | const blink::WebFloatPoint& position, |
sunyunjia | bbea8a9 | 2017-08-31 11:18:54 | [diff] [blame] | 335 | const blink::WebFloatSize& velocity, |
danakj | e819b62 | 2018-05-01 20:27:14 | [diff] [blame] | 336 | const cc::OverscrollBehavior& behavior) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 337 | void ShowVirtualKeyboardOnElementFocus() override; |
| 338 | void ConvertViewportToWindow(blink::WebRect* rect) override; |
| 339 | void ConvertWindowToViewport(blink::WebFloatRect* rect) override; |
| 340 | bool RequestPointerLock() override; |
| 341 | void RequestPointerUnlock() override; |
| 342 | bool IsPointerLocked() override; |
| 343 | void StartDragging(blink::WebReferrerPolicy policy, |
paulmeyer | 6ef5a79 | 2016-11-08 20:33:58 | [diff] [blame] | 344 | const blink::WebDragData& data, |
| 345 | blink::WebDragOperationsMask mask, |
danakj | 0c75ad8 | 2018-07-10 19:50:12 | [diff] [blame] | 346 | const SkBitmap& drag_image, |
| 347 | const blink::WebPoint& image_offset) override; |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 348 | void SetTouchAction(cc::TouchAction touch_action) override; |
| 349 | void RequestUnbufferedInputEvents() override; |
| 350 | void HasTouchEventHandlers(bool has_handlers) override; |
| 351 | void SetNeedsLowLatencyInput(bool) override; |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 352 | |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 353 | // Override point to obtain that the current input method state and caret |
| 354 | // position. |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 355 | ui::TextInputType GetTextInputType(); |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 356 | |
danakj | 4b34721 | 2018-07-04 17:55:17 | [diff] [blame] | 357 | // Internal helper that generates the LayerTreeSettings to be given to the |
| 358 | // compositor in StartCompositor(). |
| 359 | static cc::LayerTreeSettings GenerateLayerTreeSettings( |
| 360 | CompositorDependencies* compositor_deps, |
| 361 | bool is_for_subframe, |
| 362 | const gfx::Size& initial_screen_size, |
| 363 | float initial_device_scale_factor); |
| 364 | // Internal helper that generates the ManagedMemoryPolicy to be given to the |
| 365 | // compositor in StartCompositor(). |
| 366 | static cc::ManagedMemoryPolicy GetGpuMemoryPolicy( |
| 367 | const cc::ManagedMemoryPolicy& policy, |
| 368 | const gfx::Size& initial_screen_size, |
| 369 | float initial_device_scale_factor); |
| 370 | |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 371 | // Begins the compositor's scheduler to start producing frames. |
| 372 | void StartCompositor(); |
| 373 | |
[email protected] | aeeedad | 2014-08-22 18:16:22 | [diff] [blame] | 374 | // Stop compositing. |
enne | f3c5814 | 2014-12-09 21:44:38 | [diff] [blame] | 375 | void WillCloseLayerTreeView(); |
[email protected] | aeeedad | 2014-08-22 18:16:22 | [diff] [blame] | 376 | |
danakj | a6c1001 | 2018-07-06 14:25:36 | [diff] [blame] | 377 | LayerTreeView* layer_tree_view() const { return layer_tree_view_.get(); } |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 378 | WidgetInputHandlerManager* widget_input_handler_manager() { |
| 379 | return widget_input_handler_manager_.get(); |
| 380 | } |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 381 | const RenderWidgetInputHandler& input_handler() const { |
fsamuel | e8326c74 | 2016-01-12 00:49:39 | [diff] [blame] | 382 | return *input_handler_; |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 383 | } |
| 384 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 385 | void SetHandlingInputEvent(bool handling_input_event); |
| 386 | |
Sadrul Habib Chowdhury | 4e0335cf | 2018-07-31 20:08:49 | [diff] [blame] | 387 | // Delivers |message| together with compositor state change updates. |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 388 | // This mechanism is not a drop-in replacement for IPC: messages sent this way |
| 389 | // will not be automatically available to BrowserMessageFilter, for example. |
Sadrul Habib Chowdhury | 4e0335cf | 2018-07-31 20:08:49 | [diff] [blame] | 390 | // FIFO ordering is preserved between messages enqueued. |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 391 | // |
| 392 | // |msg| message to send, ownership of |msg| is transferred. |
Sadrul Habib Chowdhury | 4e0335cf | 2018-07-31 20:08:49 | [diff] [blame] | 393 | void QueueMessage(IPC::Message* msg); |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 394 | |
changwan | f2a707b | 2015-10-30 08:22:16 | [diff] [blame] | 395 | // Handle start and finish of IME event guard. |
| 396 | void OnImeEventGuardStart(ImeEventGuard* guard); |
| 397 | void OnImeEventGuardFinish(ImeEventGuard* guard); |
[email protected] | 66fca5bc | 2013-05-23 06:58:29 | [diff] [blame] | 398 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 399 | void ApplyEmulatedScreenMetricsForPopupWidget(RenderWidget* origin_widget); |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 400 | |
[email protected] | 2d6836f4 | 2014-07-02 17:25:31 | [diff] [blame] | 401 | gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor); |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 402 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 403 | // Checks if the selection bounds have been changed. If they are changed, |
| 404 | // the new value will be sent to the browser process. |
| 405 | void UpdateSelectionBounds(); |
| 406 | |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 407 | void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end); |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 408 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 409 | void OnShowHostContextMenu(ContextMenuParams* params); |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 410 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 411 | // Checks if the composition range or composition character bounds have been |
| 412 | // changed. If they are changed, the new value will be sent to the browser |
yukawa | 5f21c6a | 2014-10-27 17:09:30 | [diff] [blame] | 413 | // process. This method does nothing when the browser process is not able to |
| 414 | // handle composition range and composition character bounds. |
nona | fa29179 | 2016-08-10 02:36:18 | [diff] [blame] | 415 | // If immediate_request is true, render sends the latest composition info to |
| 416 | // the browser even if the composition info is not changed. |
| 417 | void UpdateCompositionInfo(bool immediate_request); |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 418 | |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 419 | // Override point to obtain that the current composition character bounds. |
| 420 | // In the case of surrogate pairs, the character is treated as two characters: |
| 421 | // the bounds for first character is actual one, and the bounds for second |
| 422 | // character is zero width rectangle. |
| 423 | void GetCompositionCharacterBounds(std::vector<gfx::Rect>* character_bounds); |
| 424 | |
lfg | b00fcad | 2016-07-14 14:16:33 | [diff] [blame] | 425 | // Called when the Widget has changed size as a result of an auto-resize. |
| 426 | void DidAutoResize(const gfx::Size& new_size); |
| 427 | |
Albert J. Wong | cb00463 | 2018-07-10 22:58:25 | [diff] [blame] | 428 | void DidPresentForceDrawFrame(int snapshot_id, |
| 429 | const gfx::PresentationFeedback& feedback); |
| 430 | |
lfg | e0c2792ec | 2016-05-11 18:52:08 | [diff] [blame] | 431 | // Indicates whether this widget has focus. |
| 432 | bool has_focus() const { return has_focus_; } |
| 433 | |
pwnall | ef66931 | 2017-01-07 01:17:29 | [diff] [blame] | 434 | MouseLockDispatcher* mouse_lock_dispatcher() const { |
lfg | bee1e0a | 2016-06-08 21:24:21 | [diff] [blame] | 435 | return mouse_lock_dispatcher_.get(); |
| 436 | } |
| 437 | |
Fady Samuel | a863f15 | 2018-03-09 16:10:03 | [diff] [blame] | 438 | // Returns the ScreenInfo exposed to Blink. In device emulation, this |
| 439 | // may not match the compositor ScreenInfo. |
| 440 | const ScreenInfo& GetWebScreenInfo() const; |
Christopher Cameron | e9a30c1 | 2018-03-07 08:23:38 | [diff] [blame] | 441 | |
Fady Samuel | a863f15 | 2018-03-09 16:10:03 | [diff] [blame] | 442 | // When emulated, this returns the original (non-emulated) ScreenInfo. |
| 443 | const ScreenInfo& GetOriginalScreenInfo() const; |
lfg | 1f9011c | 2016-08-17 21:18:42 | [diff] [blame] | 444 | |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 445 | // Helper to convert |point| using ConvertWindowToViewport(). |
Ella Ge | 80a52dce | 2017-11-15 18:01:52 | [diff] [blame] | 446 | gfx::PointF ConvertWindowPointToViewport(const gfx::PointF& point); |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 447 | gfx::Point ConvertWindowPointToViewport(const gfx::Point& point); |
kenrb | 5d78b84 | 2017-03-06 21:06:01 | [diff] [blame] | 448 | uint32_t GetContentSourceId(); |
Saman Sami | f773134 | 2018-01-24 22:18:44 | [diff] [blame] | 449 | void DidNavigate(); |
kenrb | 5d78b84 | 2017-03-06 21:06:01 | [diff] [blame] | 450 | |
Fady Samuel | e62be40 | 2018-03-29 03:19:53 | [diff] [blame] | 451 | bool auto_resize_mode() const { return auto_resize_mode_; } |
| 452 | |
Fady Samuel | e62be40 | 2018-03-29 03:19:53 | [diff] [blame] | 453 | const gfx::Size& min_size_for_auto_resize() const { |
| 454 | return min_size_for_auto_resize_; |
| 455 | } |
| 456 | |
| 457 | const gfx::Size& max_size_for_auto_resize() const { |
| 458 | return max_size_for_auto_resize_; |
| 459 | } |
Vladimir Levin | 98d76dad | 2018-04-21 00:21:29 | [diff] [blame] | 460 | |
| 461 | uint32_t capture_sequence_number() const { |
| 462 | return last_capture_sequence_number_; |
| 463 | } |
| 464 | |
dtapuska | 9ec1a91 | 2017-04-21 15:18:31 | [diff] [blame] | 465 | // MainThreadEventQueueClient overrides. |
| 466 | |
| 467 | // Requests a BeginMainFrame callback from the compositor. |
| 468 | void SetNeedsMainFrame() override; |
| 469 | |
Ken Buchanan | 44d7e2f | 2018-08-23 14:18:05 | [diff] [blame^] | 470 | viz::FrameSinkId GetFrameSinkIdAtPoint(const gfx::Point& point, |
| 471 | gfx::PointF* local_point); |
Navid Zolghadr | 0d86e5f | 2017-10-23 18:09:22 | [diff] [blame] | 472 | |
Dave Tapuska | ea83d3bd | 2017-06-13 16:14:55 | [diff] [blame] | 473 | void HandleInputEvent(const blink::WebCoalescedInputEvent& input_event, |
| 474 | const ui::LatencyInfo& latency_info, |
| 475 | HandledEventCallback callback) override; |
Dave Tapuska | 139a72f | 2017-09-06 21:57:03 | [diff] [blame] | 476 | |
| 477 | void SetupWidgetInputHandler(mojom::WidgetInputHandlerRequest request, |
| 478 | mojom::WidgetInputHandlerHostPtr host) override; |
dtapuska | 9ec1a91 | 2017-04-21 15:18:31 | [diff] [blame] | 479 | |
dtapuska | 9d46ef7d | 2017-05-26 19:06:06 | [diff] [blame] | 480 | scoped_refptr<MainThreadEventQueue> GetInputEventQueue(); |
| 481 | |
Albert J. Wong | cb00463 | 2018-07-10 22:58:25 | [diff] [blame] | 482 | void OnSetActive(bool active); |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 483 | void OnSetFocus(bool enable); |
Albert J. Wong | cb00463 | 2018-07-10 22:58:25 | [diff] [blame] | 484 | void OnSetBackgroundOpaque(bool opaque); |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 485 | void OnMouseCaptureLost(); |
| 486 | void OnCursorVisibilityChange(bool is_visible); |
| 487 | void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands); |
| 488 | void OnImeSetComposition( |
| 489 | const base::string16& text, |
Ryan Landay | 9e42fd74 | 2017-08-12 01:59:11 | [diff] [blame] | 490 | const std::vector<blink::WebImeTextSpan>& ime_text_spans, |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 491 | const gfx::Range& replacement_range, |
| 492 | int selection_start, |
| 493 | int selection_end); |
Ryan Landay | 9e42fd74 | 2017-08-12 01:59:11 | [diff] [blame] | 494 | void OnImeCommitText(const base::string16& text, |
| 495 | const std::vector<blink::WebImeTextSpan>& ime_text_spans, |
| 496 | const gfx::Range& replacement_range, |
| 497 | int relative_cursor_pos); |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 498 | void OnImeFinishComposingText(bool keep_selection); |
| 499 | |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 500 | // This does the actual focus change, but is called in more situations than |
| 501 | // just as an IPC message. |
| 502 | void SetFocus(bool enable); |
| 503 | |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 504 | // Called by the browser process to update text input state. |
| 505 | void OnRequestTextInputStateUpdate(); |
| 506 | |
| 507 | // Called by the browser process to update the cursor and composition |
Dave Tapuska | 04bc5ee9 | 2018-04-17 19:03:31 | [diff] [blame] | 508 | // information by sending WidgetInputHandlerHost::ImeCompositionRangeChanged. |
| 509 | // If |immediate_request| is true, an IPC is sent back with current state. |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 510 | // When |monitor_update| is true, then RenderWidget will send the updates |
| 511 | // in each compositor frame when there are changes. Outside of compositor |
| 512 | // frame updates, a change in text selection might also lead to an update for |
| 513 | // composition info (when in monitor mode). |
| 514 | void OnRequestCompositionUpdates(bool immediate_request, |
| 515 | bool monitor_updates); |
Dave Tapuska | 485aca9 | 2017-08-08 00:47:58 | [diff] [blame] | 516 | void SetWidgetBinding(mojom::WidgetRequest request); |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 517 | |
Ken Buchanan | 94c0beb6 | 2018-06-22 19:56:24 | [diff] [blame] | 518 | void SetMouseCapture(bool capture); |
| 519 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 520 | void SetWindowScreenRect(const gfx::Rect& window_screen_rect); |
Takashi SAKAMOTO | 870f626 | 2017-08-22 04:08:27 | [diff] [blame] | 521 | |
Fady Samuel | ca9ecb7 | 2018-05-05 05:59:27 | [diff] [blame] | 522 | bool IsSurfaceSynchronizationEnabled() const; |
| 523 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 524 | void UseSynchronousResizeModeForTesting(bool enable); |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 525 | void SetDeviceScaleFactorForTesting(float factor); |
| 526 | void SetDeviceColorSpaceForTesting(const gfx::ColorSpace& color_space); |
| 527 | void SetWindowRectSynchronouslyForTesting(const gfx::Rect& new_window_rect); |
| 528 | void EnableAutoResizeForTesting(const gfx::Size& min_size, |
| 529 | const gfx::Size& max_size); |
| 530 | void DisableAutoResizeForTesting(const gfx::Size& new_size); |
| 531 | |
Saman Sami | 50d1e0c | 2018-03-13 20:03:49 | [diff] [blame] | 532 | base::WeakPtr<RenderWidget> AsWeakPtr(); |
| 533 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 534 | protected: |
nick | 8331f8ad | 2016-11-15 20:42:45 | [diff] [blame] | 535 | RenderWidget(int32_t widget_routing_id, |
| 536 | CompositorDependencies* compositor_deps, |
dcheng | 35d31c11 | 2015-07-22 00:17:36 | [diff] [blame] | 537 | blink::WebPopupType popup_type, |
Scott Violet | ae08f33 | 2018-07-27 17:37:23 | [diff] [blame] | 538 | const ScreenInfo& screen_info, |
danakj | 73dd303 | 2018-07-28 17:49:53 | [diff] [blame] | 539 | blink::WebDisplayMode display_mode, |
[email protected] | 1ac10dca | 2013-08-20 20:47:04 | [diff] [blame] | 540 | bool swapped_out, |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 541 | bool hidden, |
Dave Tapuska | 1bdf183 | 2017-07-07 18:07:19 | [diff] [blame] | 542 | bool never_visible, |
Dave Tapuska | 1bdf183 | 2017-07-07 18:07:19 | [diff] [blame] | 543 | mojom::WidgetRequest widget_request = nullptr); |
[email protected] | ce2b28e | 2012-08-09 15:53:57 | [diff] [blame] | 544 | |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 545 | // Avoid making RenderWidget other than as a refptr. |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 546 | ~RenderWidget() override; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 547 | |
lfg | caab514 | 2016-02-26 19:06:52 | [diff] [blame] | 548 | static blink::WebFrameWidget* CreateWebFrameWidget( |
danakj | 9a8a9cf | 2018-07-17 23:52:12 | [diff] [blame] | 549 | blink::WebWidgetClient* widget_client, |
lfg | caab514 | 2016-02-26 19:06:52 | [diff] [blame] | 550 | blink::WebLocalFrame* frame); |
dcheng | da9b4bb | 2015-07-20 20:58:08 | [diff] [blame] | 551 | |
| 552 | // Creates a WebWidget based on the popup type. |
| 553 | static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); |
| 554 | |
nick | 4df698d8 | 2016-11-11 20:39:23 | [diff] [blame] | 555 | // Called by Create() functions and subclasses to finish initialization. |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 556 | // |show_callback| will be invoked once WebWidgetClient::Show() occurs, and |
| 557 | // should be null if Show() won't be triggered for this widget. |
Scott Violet | ae08f33 | 2018-07-27 17:37:23 | [diff] [blame] | 558 | void Init(ShowCallback show_callback, blink::WebWidget* web_widget); |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 559 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 560 | // Initialization methods used by the RenderViewImpl subclass. |
| 561 | // |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 562 | // Idle user detector is optionally set up and destroyed during |
| 563 | // initialization/teardown. |
| 564 | void SetUpIdleUserDetector(); |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 565 | // Update the web view's device scale factor. |
| 566 | void UpdateWebViewWithDeviceScaleFactor(); |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 567 | // Informs that Show() will not happen. |
| 568 | void set_did_show() { did_show_ = true; } |
| 569 | |
| 570 | // Close the underlying WebWidget and stop the compositor. |
| 571 | virtual void Close(); |
| 572 | |
| 573 | // Notify subclasses that we initiated the paint operation. |
| 574 | virtual void DidInitiatePaint() {} |
| 575 | |
| 576 | // Gets the current URL or a placeholder constant for creating 3d contexts and |
| 577 | // attributing them back to a URL. |
| 578 | virtual GURL GetURLForGraphicsContext3D(); |
| 579 | |
| 580 | // RenderWidget IPC message handler that can be overridden by subclasses. |
| 581 | virtual void OnSynchronizeVisualProperties(const VisualProperties& params); |
| 582 | |
| 583 | #if defined(OS_MACOSX) |
| 584 | // On MacOSX this message arrives on RenderViewImpl instead of here, and it |
| 585 | // needs to be able to call back to the normal message handler here. |
| 586 | void OnClose(); |
| 587 | #endif |
| 588 | |
| 589 | private: |
| 590 | // Friend RefCounted so that the dtor can be non-public. Using this class |
| 591 | // without ref-counting is an error. |
| 592 | friend class base::RefCounted<RenderWidget>; |
| 593 | |
| 594 | // TODO(nasko): Temporarily friend RenderFrameImpl for WasSwappedOut(), |
| 595 | // while we move frame specific code away from RenderViewImpl/RenderWidget. |
| 596 | friend class RenderFrameImpl; |
| 597 | |
| 598 | // For unit tests. |
| 599 | friend class InteractiveRenderWidget; |
| 600 | friend class PopupRenderWidget; |
| 601 | friend class QueueMessageSwapPromiseTest; |
| 602 | friend class RenderWidgetTest; |
| 603 | friend class RenderViewImplTest; |
| 604 | FRIEND_TEST_ALL_PREFIXES(RenderWidgetPopupUnittest, EmulatingPopupRect); |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 605 | |
Hajime Hoshi | 315a61f | 2018-08-14 17:27:28 | [diff] [blame] | 606 | static scoped_refptr<base::SingleThreadTaskRunner> GetCleanupTaskRunner(); |
| 607 | |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 608 | void DoDeferredClose(); |
dgozman | cf9039cd | 2015-04-06 12:01:31 | [diff] [blame] | 609 | void NotifyOnClose(); |
dcheng | da9b4bb | 2015-07-20 20:58:08 | [diff] [blame] | 610 | |
bokan | c63441c | 2016-04-27 15:49:12 | [diff] [blame] | 611 | gfx::Size GetSizeForWebWidget() const; |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 612 | void ResizeWebWidget(); |
bokan | c63441c | 2016-04-27 15:49:12 | [diff] [blame] | 613 | |
Ken Buchanan | ed449bb | 2018-02-01 21:02:05 | [diff] [blame] | 614 | // Just Close the WebWidget, in cases where the Close() will be deferred. |
| 615 | // It is safe to call this multiple times, which happens in the case of |
| 616 | // frame widgets beings closed, since subsequent calls are ignored. |
| 617 | void CloseWebWidget(); |
| 618 | |
thakis | 18e42641 | 2017-03-15 12:06:37 | [diff] [blame] | 619 | #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 620 | void SetExternalPopupOriginAdjustmentsForEmulation( |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 621 | ExternalPopupMenu* popup, |
| 622 | RenderWidgetScreenMetricsEmulator* emulator); |
[email protected] | 5390786 | 2014-03-25 15:42:40 | [diff] [blame] | 623 | #endif |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 624 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 625 | // RenderWidget IPC message handlers. |
nzolghadr | 5d859650 | 2017-01-23 22:59:35 | [diff] [blame] | 626 | void OnHandleInputEvent( |
| 627 | const blink::WebInputEvent* event, |
| 628 | const std::vector<const blink::WebInputEvent*>& coalesced_events, |
| 629 | const ui::LatencyInfo& latency_info, |
| 630 | InputEventDispatchType dispatch_type); |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 631 | #if !defined(OS_MACOSX) |
nasko | c288745f | 2015-05-01 22:54:21 | [diff] [blame] | 632 | void OnClose(); |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 633 | #endif |
[email protected] | fc4404d | 2012-11-07 19:53:30 | [diff] [blame] | 634 | void OnCreatingNewAck(); |
dgozman | 9260b0a1 | 2015-03-16 13:45:20 | [diff] [blame] | 635 | void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params); |
| 636 | void OnDisableDeviceEmulation(); |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 637 | void OnWasHidden(); |
| 638 | void OnWasShown(bool needs_repainting, |
| 639 | base::TimeTicks show_request_timestamp); |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 640 | void OnCreateVideoAck(int32_t video_id); |
| 641 | void OnUpdateVideoAck(int32_t video_id); |
Avi Drissman | 014dec7 | 2018-06-07 02:34:01 | [diff] [blame] | 642 | void OnRequestSetBoundsAck(); |
Albert J. Wong | cb00463 | 2018-07-10 22:58:25 | [diff] [blame] | 643 | void OnForceRedraw(int snapshot_id); |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 644 | void OnShowContextMenu(ui::MenuSourceType source_type, |
| 645 | const gfx::Point& location); |
oshima | d527903 | 2015-12-16 18:22:33 | [diff] [blame] | 646 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 647 | void OnSetTextDirection(blink::WebTextDirection direction); |
[email protected] | 872ae5b | 2011-05-26 20:20:50 | [diff] [blame] | 648 | void OnGetFPS(); |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 649 | void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
| 650 | const gfx::Rect& window_screen_rect); |
Ken Buchanan | b2c9e26 | 2018-03-10 16:53:31 | [diff] [blame] | 651 | void OnSetViewportIntersection(const gfx::Rect& viewport_intersection, |
Stefan Zager | 54e2583 | 2018-08-14 22:15:31 | [diff] [blame] | 652 | const gfx::Rect& compositor_visible_rect, |
| 653 | bool occluded_or_obscured); |
kenrb | 0432378 | 2017-06-23 01:23:32 | [diff] [blame] | 654 | void OnSetIsInert(bool); |
sunxd | 540a996 | 2018-05-24 22:51:06 | [diff] [blame] | 655 | void OnSetInheritedEffectiveTouchAction(cc::TouchAction touch_action); |
Ken Buchanan | 8a319fb | 2017-11-15 18:37:12 | [diff] [blame] | 656 | void OnUpdateRenderThrottlingStatus(bool is_throttled, |
| 657 | bool subtree_throttled); |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 658 | void OnDragTargetDragEnter( |
| 659 | const std::vector<DropData::Metadata>& drop_meta_data, |
Ella Ge | 80a52dce | 2017-11-15 18:01:52 | [diff] [blame] | 660 | const gfx::PointF& client_pt, |
| 661 | const gfx::PointF& screen_pt, |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 662 | blink::WebDragOperationsMask operations_allowed, |
| 663 | int key_modifiers); |
Ella Ge | 80a52dce | 2017-11-15 18:01:52 | [diff] [blame] | 664 | void OnDragTargetDragOver(const gfx::PointF& client_pt, |
| 665 | const gfx::PointF& screen_pt, |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 666 | blink::WebDragOperationsMask operations_allowed, |
| 667 | int key_modifiers); |
Ella Ge | 80a52dce | 2017-11-15 18:01:52 | [diff] [blame] | 668 | void OnDragTargetDragLeave(const gfx::PointF& client_point, |
| 669 | const gfx::PointF& screen_point); |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 670 | void OnDragTargetDrop(const DropData& drop_data, |
Ella Ge | 80a52dce | 2017-11-15 18:01:52 | [diff] [blame] | 671 | const gfx::PointF& client_pt, |
| 672 | const gfx::PointF& screen_pt, |
paulmeyer | 90f6c31d | 2016-11-12 00:17:59 | [diff] [blame] | 673 | int key_modifiers); |
Ella Ge | 80a52dce | 2017-11-15 18:01:52 | [diff] [blame] | 674 | void OnDragSourceEnded(const gfx::PointF& client_point, |
| 675 | const gfx::PointF& screen_point, |
paulmeyer | 8fc8ea9 | 2016-11-15 05:12:21 | [diff] [blame] | 676 | blink::WebDragOperation drag_operation); |
| 677 | void OnDragSourceSystemDragEnded(); |
lfg | 8d649cc | 2017-04-28 18:04:30 | [diff] [blame] | 678 | void OnOrientationChange(); |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 679 | void OnWaitNextFrameForTests(int routing_id); |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 680 | |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 681 | // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
| 682 | // use this method so that we can properly inform the RenderThread of our |
| 683 | // state. |
| 684 | void SetHidden(bool hidden); |
| 685 | |
[email protected] | 2b624c56 | 2011-10-27 22:58:26 | [diff] [blame] | 686 | void DidToggleFullscreen(); |
| 687 | |
Ken Buchanan | b2c9e26 | 2018-03-10 16:53:31 | [diff] [blame] | 688 | // Returns a rect that the compositor needs to raster. For a main frame this |
| 689 | // is always the entire viewprot, but for out-of-process iframes this can be |
| 690 | // constrained to limit overdraw. |
| 691 | gfx::Rect ViewportVisibleRect(); |
| 692 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 693 | // QueueMessage implementation extracted into a static method for easy |
| 694 | // testing. |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 695 | static std::unique_ptr<cc::SwapPromise> QueueMessageImpl( |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 696 | IPC::Message* msg, |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 697 | FrameSwapMessageQueue* frame_swap_message_queue, |
| 698 | scoped_refptr<IPC::SyncMessageFilter> sync_message_filter, |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 699 | int source_frame_number); |
| 700 | |
[email protected] | 88dbe32f | 2013-06-20 23:31:36 | [diff] [blame] | 701 | // Returns the range of the text that is being composed or the selection if |
| 702 | // the composition does not exist. |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 703 | void GetCompositionRange(gfx::Range* range); |
[email protected] | 88dbe32f | 2013-06-20 23:31:36 | [diff] [blame] | 704 | |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 705 | // Returns true if the composition range or composition character bounds |
| 706 | // should be sent to the browser process. |
| 707 | bool ShouldUpdateCompositionInfo( |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 708 | const gfx::Range& range, |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 709 | const std::vector<gfx::Rect>& bounds); |
| 710 | |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 711 | // Override point to obtain that the current input method state about |
| 712 | // composition text. |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 713 | bool CanComposeInline(); |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 714 | |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 715 | // Set the pending window rect. |
| 716 | // Because the real render_widget is hosted in another process, there is |
| 717 | // a time period where we may have set a new window rect which has not yet |
| 718 | // been processed by the browser. So we maintain a pending window rect |
| 719 | // size. If JS code sets the WindowRect, and then immediately calls |
| 720 | // GetWindowRect() we'll use this pending window rect as the size. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 721 | void SetPendingWindowRect(const blink::WebRect& r); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 722 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 723 | // TODO(ekaramad): This method should not be confused with its RenderView |
| 724 | // variant, GetWebFrameWidget(). Currently Cast and AndroidWebview's |
| 725 | // ContentRendererClients are the only users of the public variant. The public |
| 726 | // method will eventually be removed from RenderView and uses of the method |
| 727 | // will obtain WebFrameWidget from WebLocalFrame. |
| 728 | // Returns the WebFrameWidget associated with this RenderWidget if any. |
| 729 | // Returns nullptr if GetWebWidget() returns nullptr or returns a WebWidget |
| 730 | // that is not a WebFrameWidget. A WebFrameWidget only makes sense when there |
| 731 | // a local root associated with it. RenderWidgetFullscreenPepper and a swapped |
| 732 | // out RenderWidgets are amongst the cases where this method returns nullptr. |
| 733 | blink::WebFrameWidget* GetFrameWidget() const; |
[email protected] | ce6689f | 2013-03-29 12:52:55 | [diff] [blame] | 734 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 735 | // Applies/Removes the DevTools device emulation transformation to/from a |
| 736 | // window rect. |
| 737 | void ScreenRectToEmulatedIfNeeded(blink::WebRect* window_rect) const; |
| 738 | void EmulatedToScreenRectIfNeeded(blink::WebRect* window_rect) const; |
Dave Tapuska | dfe486c1 | 2017-06-09 16:53:13 | [diff] [blame] | 739 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 740 | bool CreateWidget(int32_t opener_id, |
| 741 | blink::WebPopupType popup_type, |
| 742 | int32_t* routing_id); |
Dave Tapuska | bafc2ba3 | 2017-11-28 01:54:37 | [diff] [blame] | 743 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 744 | void UpdateSurfaceAndScreenInfo( |
| 745 | const viz::LocalSurfaceId& new_local_surface_id, |
| 746 | const gfx::Size& new_compositor_viewport_pixel_size, |
| 747 | const ScreenInfo& new_screen_info); |
[email protected] | 5d0bbdfa9 | 2013-12-10 00:35:51 | [diff] [blame] | 748 | |
danakj | 5380269 | 2018-07-25 21:46:44 | [diff] [blame] | 749 | // Used to force the size of a window when running layout tests. |
| 750 | void SetWindowRectSynchronously(const gfx::Rect& new_window_rect); |
| 751 | |
| 752 | void UpdateCaptureSequenceNumber(uint32_t capture_sequence_number); |
| 753 | |
| 754 | // A variant of Send but is fatal if it fails. The browser may |
| 755 | // be waiting for this IPC Message and if the send fails the browser will |
| 756 | // be left in a state waiting for something that never comes. And if it |
| 757 | // never comes then it may later determine this is a hung renderer; so |
| 758 | // instead fail right away. |
| 759 | void SendOrCrash(IPC::Message* msg); |
| 760 | |
| 761 | // Determines whether or not RenderWidget should process IME events from the |
| 762 | // browser. It always returns true unless there is no WebFrameWidget to |
| 763 | // handle the event, or there is no page focus. |
| 764 | bool ShouldHandleImeEvents() const; |
| 765 | |
| 766 | void UpdateTextInputStateInternal(bool show_virtual_keyboard, |
| 767 | bool reply_to_request); |
| 768 | |
| 769 | gfx::ColorSpace GetRasterColorSpace() const; |
| 770 | |
| 771 | void SendInputEventAck(blink::WebInputEvent::Type type, |
| 772 | uint32_t touch_event_id, |
| 773 | InputEventAckState ack_state, |
| 774 | const ui::LatencyInfo& latency_info, |
| 775 | std::unique_ptr<ui::DidOverscrollParams>, |
| 776 | base::Optional<cc::TouchAction>); |
| 777 | |
| 778 | void UpdateZoom(double zoom_level); |
| 779 | |
| 780 | #if BUILDFLAG(ENABLE_PLUGINS) |
| 781 | // Returns the focused pepper plugin, if any, inside the WebWidget. That is |
| 782 | // the pepper plugin which is focused inside a frame which belongs to the |
| 783 | // local root associated with this RenderWidget. |
| 784 | PepperPluginInstanceImpl* GetFocusedPepperPluginInsideWidget(); |
| 785 | #endif |
| 786 | void RecordTimeToFirstActivePaint(); |
| 787 | |
| 788 | // Updates the URL used by the compositor for keying UKM metrics. |
| 789 | // Note that this uses the main frame's URL and only if its available in the |
| 790 | // current process. In the case where it is not available, no metrics will be |
| 791 | // recorded. |
| 792 | void UpdateURLForCompositorUkm(); |
| 793 | |
| 794 | // This method returns the WebLocalFrame which is currently focused and |
| 795 | // belongs to the frame tree associated with this RenderWidget. |
| 796 | blink::WebLocalFrame* GetFocusedWebLocalFrameInWidget() const; |
lfg | 43e08e6 | 2016-02-03 18:51:37 | [diff] [blame] | 797 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 798 | // Routing ID that allows us to communicate to the parent browser process |
nick | 8331f8ad | 2016-11-15 20:42:45 | [diff] [blame] | 799 | // RenderWidgetHost. |
| 800 | const int32_t routing_id_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 801 | |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 802 | // Dependencies for initializing a compositor, including flags for optional |
| 803 | // features. |
dcheng | 35d31c11 | 2015-07-22 00:17:36 | [diff] [blame] | 804 | CompositorDependencies* const compositor_deps_; |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 805 | |
lfg | 8ff3391 | 2016-09-13 20:59:21 | [diff] [blame] | 806 | // Use GetWebWidget() instead of using webwidget_internal_ directly. |
[email protected] | c5b3b5e | 2009-02-13 06:41:11 | [diff] [blame] | 807 | // We are responsible for destroying this object via its Close method. |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 808 | // May be NULL when the window is closing. |
lfg | 8ff3391 | 2016-09-13 20:59:21 | [diff] [blame] | 809 | blink::WebWidget* webwidget_internal_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 810 | |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 811 | // The delegate of the owner of this object. |
| 812 | RenderWidgetOwnerDelegate* owner_delegate_; |
| 813 | |
[email protected] | 8926c60 | 2013-01-23 05:32:06 | [diff] [blame] | 814 | // This is lazily constructed and must not outlive webwidget_. |
danakj | a6c1001 | 2018-07-06 14:25:36 | [diff] [blame] | 815 | std::unique_ptr<LayerTreeView> layer_tree_view_; |
[email protected] | 8926c60 | 2013-01-23 05:32:06 | [diff] [blame] | 816 | |
bokan | c007c3a | 2015-02-03 07:15:56 | [diff] [blame] | 817 | // The rect where this view should be initially shown. |
| 818 | gfx::Rect initial_rect_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 819 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 820 | // We store the current cursor object so we can avoid spamming SetCursor |
| 821 | // messages. |
| 822 | WebCursor current_cursor_; |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 823 | |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 824 | base::Optional<float> device_scale_factor_for_testing_; |
| 825 | |
Christopher Cameron | be7ecea | 2018-02-27 00:47:19 | [diff] [blame] | 826 | // The size of the RenderWidget in DIPs. This may differ from |
Christopher Cameron | aad15a0d | 2018-03-09 03:47:33 | [diff] [blame] | 827 | // |compositor_viewport_pixel_size_| in the following (and possibly other) |
| 828 | // cases: * On Android, for top and bottom controls * On OOPIF, due to |
| 829 | // rounding |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 830 | gfx::Size size_; |
| 831 | |
Christopher Cameron | be7ecea | 2018-02-27 00:47:19 | [diff] [blame] | 832 | // The size of the compositor's surface in pixels. |
Christopher Cameron | aad15a0d | 2018-03-09 03:47:33 | [diff] [blame] | 833 | gfx::Size compositor_viewport_pixel_size_; |
[email protected] | 60d47ac | 2013-03-01 23:42:44 | [diff] [blame] | 834 | |
Christopher Cameron | be7ecea | 2018-02-27 00:47:19 | [diff] [blame] | 835 | // The size of the visible viewport in pixels. |
[email protected] | bb6378fe | 2014-04-28 21:19:44 | [diff] [blame] | 836 | gfx::Size visible_viewport_size_; |
| 837 | |
[email protected] | 847a258 | 2013-03-09 02:29:51 | [diff] [blame] | 838 | // Whether the WebWidget is in auto resize mode, which is used for example |
| 839 | // by extension popups. |
| 840 | bool auto_resize_mode_; |
| 841 | |
Fady Samuel | e62be40 | 2018-03-29 03:19:53 | [diff] [blame] | 842 | // The minimum size to use for auto-resize. |
| 843 | gfx::Size min_size_for_auto_resize_; |
| 844 | |
| 845 | // The maximum size to use for auto-resize. |
| 846 | gfx::Size max_size_for_auto_resize_; |
| 847 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 848 | // Set to true if we should ignore RenderWidget::Show calls. |
| 849 | bool did_show_; |
| 850 | |
| 851 | // Indicates that we shouldn't bother generated paint events. |
| 852 | bool is_hidden_; |
| 853 | |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 854 | // Indicates that we are never visible, so never produce graphical output. |
sievers | 71c62dd5 | 2015-10-07 01:44:39 | [diff] [blame] | 855 | const bool compositor_never_visible_; |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 856 | |
mikhail.pozdnyakov | f2c902a | 2015-04-14 08:09:12 | [diff] [blame] | 857 | // Indicates whether tab-initiated fullscreen was granted. |
| 858 | bool is_fullscreen_granted_; |
[email protected] | ee41e7d2 | 2011-10-14 19:34:09 | [diff] [blame] | 859 | |
mikhail.pozdnyakov | c0e251b | 2015-04-15 06:51:12 | [diff] [blame] | 860 | // Indicates the display mode. |
| 861 | blink::WebDisplayMode display_mode_; |
| 862 | |
changwan | f2a707b | 2015-10-30 08:22:16 | [diff] [blame] | 863 | // It is possible that one ImeEventGuard is nested inside another |
| 864 | // ImeEventGuard. We keep track of the outermost one, and update it as needed. |
| 865 | ImeEventGuard* ime_event_guard_; |
[email protected] | e8f775f | 2013-02-14 21:00:50 | [diff] [blame] | 866 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 867 | // True if we have requested this widget be closed. No more messages will |
| 868 | // be sent, except for a Close. |
| 869 | bool closing_; |
| 870 | |
[email protected] | aeeedad | 2014-08-22 18:16:22 | [diff] [blame] | 871 | // True if it is known that the host is in the process of being shut down. |
| 872 | bool host_closing_; |
| 873 | |
[email protected] | 992db4c | 2011-05-12 15:37:15 | [diff] [blame] | 874 | // Whether this RenderWidget is currently swapped out, such that the view is |
| 875 | // being rendered by another process. If all RenderWidgets in a process are |
| 876 | // swapped out, the process can exit. |
| 877 | bool is_swapped_out_; |
| 878 | |
[email protected] | 5b739cb | 2012-08-21 20:35:21 | [diff] [blame] | 879 | // Stores information about the current text input. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 880 | blink::WebTextInputInfo text_input_info_; |
[email protected] | 5b739cb | 2012-08-21 20:35:21 | [diff] [blame] | 881 | |
dglazkov | 97b6c2b | 2016-10-25 17:35:55 | [diff] [blame] | 882 | // Stores the current text input type of |webwidget_|. |
| 883 | ui::TextInputType text_input_type_; |
| 884 | |
[email protected] | b256eca | 2013-07-11 10:57:40 | [diff] [blame] | 885 | // Stores the current text input mode of |webwidget_|. |
| 886 | ui::TextInputMode text_input_mode_; |
| 887 | |
shuchen | 82ce8c5 | 2014-10-23 01:55:20 | [diff] [blame] | 888 | // Stores the current text input flags of |webwidget_|. |
| 889 | int text_input_flags_; |
| 890 | |
AJITH KUMAR V | 041c0b0 | 2017-08-08 10:39:20 | [diff] [blame] | 891 | // Indicates whether currently focused input field has next/previous focusable |
| 892 | // form input field. |
| 893 | int next_previous_flags_; |
| 894 | |
[email protected] | 86ba5fcb | 2013-09-04 00:36:53 | [diff] [blame] | 895 | // Stores the current type of composition text rendering of |webwidget_|. |
| 896 | bool can_compose_inline_; |
| 897 | |
[email protected] | e99ef6f | 2011-10-16 01:13:00 | [diff] [blame] | 898 | // Stores the current selection bounds. |
[email protected] | 7c8873e | 2013-02-05 08:03:01 | [diff] [blame] | 899 | gfx::Rect selection_focus_rect_; |
| 900 | gfx::Rect selection_anchor_rect_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 901 | |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 902 | // Stores the current composition character bounds. |
| 903 | std::vector<gfx::Rect> composition_character_bounds_; |
| 904 | |
| 905 | // Stores the current composition range. |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 906 | gfx::Range composition_range_; |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 907 | |
[email protected] | 3e2b375b | 2010-04-07 17:03:12 | [diff] [blame] | 908 | // The kind of popup this widget represents, NONE if not a popup. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 909 | blink::WebPopupType popup_type_; |
[email protected] | 0ebf387 | 2008-11-07 21:35:03 | [diff] [blame] | 910 | |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 911 | // While we are waiting for the browser to update window sizes, we track the |
| 912 | // pending size temporarily. |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 913 | int pending_window_rect_count_; |
lfg | 0140a45 | 2016-07-19 19:15:05 | [diff] [blame] | 914 | gfx::Rect pending_window_rect_; |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 915 | |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 916 | // The screen rects of the view and the window that contains it. |
| 917 | gfx::Rect view_screen_rect_; |
| 918 | gfx::Rect window_screen_rect_; |
| 919 | |
Dave Tapuska | 9db8084 | 2017-07-24 17:24:26 | [diff] [blame] | 920 | scoped_refptr<WidgetInputHandlerManager> widget_input_handler_manager_; |
| 921 | |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 922 | std::unique_ptr<RenderWidgetInputHandler> input_handler_; |
[email protected] | 12fbad81 | 2009-09-01 18:21:24 | [diff] [blame] | 923 | |
[email protected] | fd84779 | 2013-10-24 17:12:35 | [diff] [blame] | 924 | // The time spent in input handlers this frame. Used to throttle input acks. |
| 925 | base::TimeDelta total_input_handling_time_this_frame_; |
| 926 | |
[email protected] | 842f1065 | 2012-06-06 01:54:04 | [diff] [blame] | 927 | // Properties of the screen hosting this RenderWidget instance. |
ccameron | 2f45153 | 2016-09-07 21:49:27 | [diff] [blame] | 928 | ScreenInfo screen_info_; |
[email protected] | 842f1065 | 2012-06-06 01:54:04 | [diff] [blame] | 929 | |
nona | fa29179 | 2016-08-10 02:36:18 | [diff] [blame] | 930 | // True if the IME requests updated composition info. |
| 931 | bool monitor_composition_info_; |
| 932 | |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 933 | std::unique_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 934 | |
| 935 | // Popups may be displaced when screen metrics emulation is enabled. |
| 936 | // These values are used to properly adjust popup position. |
danakj | 2ef31b8 | 2015-10-21 18:18:02 | [diff] [blame] | 937 | gfx::Point popup_view_origin_for_emulation_; |
| 938 | gfx::Point popup_screen_origin_for_emulation_; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 939 | float popup_origin_scale_for_emulation_; |
| 940 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 941 | scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 942 | std::unique_ptr<ResizingModeSelector> resizing_mode_selector_; |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 943 | |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 944 | // Lists of RenderFrameProxy objects that need to be notified of |
| 945 | // compositing-related events (e.g. DidCommitCompositorFrame). |
Trent Apted | a250ec3ab | 2018-08-19 08:52:19 | [diff] [blame] | 946 | base::ObserverList<RenderFrameProxy>::Unchecked render_frame_proxies_; |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 947 | |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 948 | // A list of RenderFrames associated with this RenderWidget. Notifications |
| 949 | // are sent to each frame in the list for events such as changing |
| 950 | // visibility state for example. |
Trent Apted | a250ec3ab | 2018-08-19 08:52:19 | [diff] [blame] | 951 | base::ObserverList<RenderFrameImpl>::Unchecked render_frames_; |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 952 | |
Trent Apted | a250ec3ab | 2018-08-19 08:52:19 | [diff] [blame] | 953 | base::ObserverList<BrowserPlugin>::Unchecked browser_plugins_; |
Saman Sami | d189e5dfd | 2017-12-20 22:55:31 | [diff] [blame] | 954 | |
[email protected] | be1af066 | 2014-07-29 19:55:51 | [diff] [blame] | 955 | bool has_host_context_menu_location_; |
| 956 | gfx::Point host_context_menu_location_; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 957 | |
Yuta Kitamura | 39219b4 | 2018-04-06 10:28:14 | [diff] [blame] | 958 | std::unique_ptr<blink::scheduler::WebRenderWidgetSchedulingState> |
alexclarke | 7fa9394 | 2015-10-21 15:37:11 | [diff] [blame] | 959 | render_widget_scheduling_state_; |
| 960 | |
lfg | bee1e0a | 2016-06-08 21:24:21 | [diff] [blame] | 961 | // Mouse Lock dispatcher attached to this view. |
| 962 | std::unique_ptr<RenderWidgetMouseLockDispatcher> mouse_lock_dispatcher_; |
| 963 | |
| 964 | // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
| 965 | std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
| 966 | |
Fady Samuel | 4255c18 | 2018-05-24 20:42:36 | [diff] [blame] | 967 | viz::LocalSurfaceId local_surface_id_from_parent_; |
Fady Samuel | da839bb | 2018-03-26 17:34:48 | [diff] [blame] | 968 | |
lfg | e0c2792ec | 2016-05-11 18:52:08 | [diff] [blame] | 969 | // Indicates whether this widget has focus. |
| 970 | bool has_focus_; |
| 971 | |
Nicolas Pena | 75a35d66 | 2018-04-05 20:13:44 | [diff] [blame] | 972 | // Whether this RenderWidget is for an out-of-process iframe or not. |
| 973 | bool for_oopif_; |
| 974 | |
nick | f7b3822 | 2016-11-22 21:59:35 | [diff] [blame] | 975 | // A callback into the creator/opener of this widget, to be executed when |
danakj | df1ceb7 | 2018-07-18 20:02:25 | [diff] [blame] | 976 | // WebWidgetClient::Show() occurs. |
nick | f7b3822 | 2016-11-22 21:59:35 | [diff] [blame] | 977 | ShowCallback show_callback_; |
| 978 | |
ekaramad | 330ba423 | 2016-09-23 17:57:47 | [diff] [blame] | 979 | #if defined(OS_MACOSX) |
| 980 | // Responds to IPCs from TextInputClientMac regarding getting string at given |
| 981 | // position or range as well as finding character index at a given position. |
| 982 | std::unique_ptr<TextInputClientObserver> text_input_client_observer_; |
| 983 | #endif |
| 984 | |
alexmos | 5656749 | 2016-09-13 00:52:46 | [diff] [blame] | 985 | // Stores edit commands associated to the next key event. |
| 986 | // Will be cleared as soon as the next key event is processed. |
| 987 | EditCommands edit_commands_; |
| 988 | |
paulmeyer | 6ef5a79 | 2016-11-08 20:33:58 | [diff] [blame] | 989 | // This field stores drag/drop related info for the event that is currently |
| 990 | // being handled. If the current event results in starting a drag/drop |
| 991 | // session, this info is sent to the browser along with other drag/drop info. |
| 992 | DragEventSourceInfo possible_drag_event_info_; |
| 993 | |
Takashi SAKAMOTO | 870f626 | 2017-08-22 04:08:27 | [diff] [blame] | 994 | bool first_update_visual_state_after_hidden_; |
tasak | b95dbb50c | 2017-02-08 18:07:50 | [diff] [blame] | 995 | base::TimeTicks was_shown_time_; |
| 996 | |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 997 | // Whether or not Blink's viewport size should be shrunk by the height of the |
| 998 | // URL-bar. |
| 999 | bool browser_controls_shrink_blink_size_ = false; |
| 1000 | // The height of the browser top controls. |
| 1001 | float top_controls_height_ = 0.f; |
| 1002 | // The height of the browser bottom controls. |
| 1003 | float bottom_controls_height_ = 0.f; |
| 1004 | |
kenrb | 5d78b84 | 2017-03-06 21:06:01 | [diff] [blame] | 1005 | // This is initialized to zero and is incremented on each non-same-page |
| 1006 | // navigation commit by RenderFrameImpl. At that time it is sent to the |
| 1007 | // compositor so that it can tag compositor frames, and RenderFrameImpl is |
| 1008 | // responsible for sending it to the browser process to be used to match |
| 1009 | // each compositor frame to the most recent page navigation before it was |
| 1010 | // generated. |
| 1011 | // This only applies to main frames, and is not touched for subframe |
| 1012 | // RenderWidgets, where there is no concern around displaying unloaded |
| 1013 | // content. |
| 1014 | // TODO(kenrb, fsamuel): This should be removed when SurfaceIDs can be used |
| 1015 | // to replace it. See https://crbug.com/695579. |
| 1016 | uint32_t current_content_source_id_; |
| 1017 | |
dtapuska | 9ec1a91 | 2017-04-21 15:18:31 | [diff] [blame] | 1018 | scoped_refptr<MainThreadEventQueue> input_event_queue_; |
| 1019 | |
Dave Tapuska | 1bdf183 | 2017-07-07 18:07:19 | [diff] [blame] | 1020 | mojo::Binding<mojom::Widget> widget_binding_; |
danakj | a2c9d0a9 | 2018-07-25 20:01:18 | [diff] [blame] | 1021 | // IdleUserDetector is setup optionally on RenderWidget by its creator, so may |
| 1022 | // be null. |
| 1023 | std::unique_ptr<IdleUserDetector> idle_user_detector_; |
Hajime Hoshi | abb3c8f | 2017-12-04 18:41:39 | [diff] [blame] | 1024 | |
Ken Buchanan | b2c9e26 | 2018-03-10 16:53:31 | [diff] [blame] | 1025 | gfx::Rect compositor_visible_rect_; |
| 1026 | |
W. James MacLean | 662d538 | 2018-03-29 18:33:08 | [diff] [blame] | 1027 | // Different consumers in the browser process makes different assumptions, so |
| 1028 | // must always send the first IPC regardless of value. |
| 1029 | base::Optional<bool> has_touch_handlers_; |
| 1030 | |
Vladimir Levin | 98d76dad | 2018-04-21 00:21:29 | [diff] [blame] | 1031 | uint32_t last_capture_sequence_number_ = 0u; |
| 1032 | |
wjmaclean | 1d97062 | 2017-01-21 22:28:24 | [diff] [blame] | 1033 | base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; |
| 1034 | |
[email protected] | 05d47875 | 2009-04-08 23:38:16 | [diff] [blame] | 1035 | DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 1036 | }; |
| 1037 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 1038 | } // namespace content |
| 1039 | |
[email protected] | 2cff005 | 2011-03-18 16:51:44 | [diff] [blame] | 1040 | #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |