[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] | aa4117f | 2011-12-09 22:19:21 | [diff] [blame] | 11 | #include <deque> |
[email protected] | 0e241b4b | 2012-08-18 09:06:27 | [diff] [blame] | 12 | #include <map> |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 13 | #include <memory> |
[email protected] | 010ea08a | 2009-10-11 20:21:32 | [diff] [blame] | 14 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 15 | #include "base/callback.h" |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 16 | #include "base/compiler_specific.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 17 | #include "base/macros.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 18 | #include "base/memory/ref_counted.h" |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 19 | #include "base/observer_list.h" |
[email protected] | abb52216 | 2013-06-28 01:54:16 | [diff] [blame] | 20 | #include "base/time/time.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 21 | #include "build/build_config.h" |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 22 | #include "content/common/content_export.h" |
[email protected] | c2809346d | 2014-03-20 00:11:03 | [diff] [blame] | 23 | #include "content/common/cursors/webcursor.h" |
[email protected] | 9017d785 | 2013-11-21 17:47:35 | [diff] [blame] | 24 | #include "content/common/input/synthetic_gesture_params.h" |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 25 | #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delegate.h" |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 26 | #include "content/renderer/gpu/render_widget_compositor_delegate.h" |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 27 | #include "content/renderer/input/render_widget_input_handler.h" |
| 28 | #include "content/renderer/input/render_widget_input_handler_delegate.h" |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 29 | #include "content/renderer/message_delivery_policy.h" |
lfg | bee1e0a | 2016-06-08 21:24:21 | [diff] [blame] | 30 | #include "content/renderer/mouse_lock_dispatcher.h" |
| 31 | #include "content/renderer/render_widget_mouse_lock_dispatcher.h" |
[email protected] | 4f86bdb | 2012-11-10 19:11:19 | [diff] [blame] | 32 | #include "ipc/ipc_listener.h" |
| 33 | #include "ipc/ipc_sender.h" |
mikhail.pozdnyakov | c0e251b | 2015-04-15 06:51:12 | [diff] [blame] | 34 | #include "third_party/WebKit/public/platform/WebDisplayMode.h" |
[email protected] | 5c30b5e0 | 2013-05-30 03:46:08 | [diff] [blame] | 35 | #include "third_party/WebKit/public/platform/WebRect.h" |
[email protected] | 2255a933 | 2013-06-17 05:12:31 | [diff] [blame] | 36 | #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
[email protected] | c27dd4f | 2014-05-22 18:05:19 | [diff] [blame] | 37 | #include "third_party/WebKit/public/web/WebInputEvent.h" |
[email protected] | 2255a933 | 2013-06-17 05:12:31 | [diff] [blame] | 38 | #include "third_party/WebKit/public/web/WebPopupType.h" |
| 39 | #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 40 | #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
[email protected] | 5d0bbdfa9 | 2013-12-10 00:35:51 | [diff] [blame] | 41 | #include "third_party/WebKit/public/web/WebTouchAction.h" |
[email protected] | 0e45bd0 | 2013-07-12 20:20:02 | [diff] [blame] | 42 | #include "third_party/WebKit/public/web/WebWidget.h" |
[email protected] | 2255a933 | 2013-06-17 05:12:31 | [diff] [blame] | 43 | #include "third_party/WebKit/public/web/WebWidgetClient.h" |
[email protected] | b256eca | 2013-07-11 10:57:40 | [diff] [blame] | 44 | #include "ui/base/ime/text_input_mode.h" |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 45 | #include "ui/base/ime/text_input_type.h" |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 46 | #include "ui/base/ui_base_types.h" |
tfarina | 93bfa91 | 2014-12-05 14:23:15 | [diff] [blame] | 47 | #include "ui/gfx/geometry/rect.h" |
tfarina | 93bfa91 | 2014-12-05 14:23:15 | [diff] [blame] | 48 | #include "ui/gfx/geometry/vector2d_f.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 49 | #include "ui/gfx/native_widget_types.h" |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 50 | #include "ui/gfx/range/range.h" |
[email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 51 | #include "ui/surface/transport_dib.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 52 | |
danakj | 870925d | 2016-05-03 20:07:38 | [diff] [blame] | 53 | class GURL; |
| 54 | |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 55 | namespace IPC { |
| 56 | class SyncMessage; |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 57 | class SyncMessageFilter; |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 58 | } |
| 59 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 60 | namespace blink { |
skyostil | 529caa29 | 2016-08-10 17:44:51 | [diff] [blame^] | 61 | namespace scheduler { |
| 62 | class RenderWidgetSchedulingState; |
| 63 | } |
[email protected] | 1919368 | 2014-04-03 15:01:43 | [diff] [blame] | 64 | struct WebDeviceEmulationParams; |
lfg | caab514 | 2016-02-26 19:06:52 | [diff] [blame] | 65 | class WebFrameWidget; |
[email protected] | 41d8685 | 2012-11-07 12:23:24 | [diff] [blame] | 66 | class WebGestureEvent; |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 67 | class WebLocalFrame; |
[email protected] | 6a8ddba5 | 2010-09-05 04:38:06 | [diff] [blame] | 68 | class WebMouseEvent; |
donnd | a070f3c | 2015-01-16 19:54:11 | [diff] [blame] | 69 | class WebNode; |
| 70 | struct WebPoint; |
[email protected] | 52647690 | 2011-10-06 20:34:06 | [diff] [blame] | 71 | } |
| 72 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 73 | namespace cc { |
| 74 | class OutputSurface; |
| 75 | class SwapPromise; |
| 76 | } |
[email protected] | ba91a79 | 2013-02-06 09:48:28 | [diff] [blame] | 77 | |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 78 | namespace gfx { |
[email protected] | 4de6d169 | 2011-10-12 08:45:44 | [diff] [blame] | 79 | class Range; |
| 80 | } |
| 81 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 82 | namespace content { |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 83 | class CompositorDependencies; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 84 | class ExternalPopupMenu; |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 85 | class FrameSwapMessageQueue; |
changwan | f2a707b | 2015-10-30 08:22:16 | [diff] [blame] | 86 | class ImeEventGuard; |
ekaramad | 2a46d63 | 2016-07-19 13:33:09 | [diff] [blame] | 87 | class PepperPluginInstanceImpl; |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 88 | class RenderFrameImpl; |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 89 | class RenderFrameProxy; |
[email protected] | ba91a79 | 2013-02-06 09:48:28 | [diff] [blame] | 90 | class RenderWidgetCompositor; |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 91 | class RenderWidgetOwnerDelegate; |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 92 | class RenderWidgetScreenMetricsEmulator; |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 93 | class ResizingModeSelector; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 94 | struct ContextMenuParams; |
jdduke | c05612b | 2015-06-25 23:13:18 | [diff] [blame] | 95 | struct DidOverscrollParams; |
fsamuel | 664e8b6 | 2016-01-20 19:54:01 | [diff] [blame] | 96 | struct ResizeParams; |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 97 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 98 | // RenderWidget provides a communication bridge between a WebWidget and |
| 99 | // a RenderWidgetHost, the latter of which lives in a different process. |
dcheng | d96a27a | 2015-07-24 20:17:32 | [diff] [blame] | 100 | // |
| 101 | // RenderWidget is used to implement: |
| 102 | // - RenderViewImpl (deprecated) |
| 103 | // - Fullscreen mode (RenderWidgetFullScreen) |
| 104 | // - Popup "menus" (like the color chooser and date picker) |
| 105 | // - Widgets for frames (for out-of-process iframe support) |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 106 | class CONTENT_EXPORT RenderWidget |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 107 | : public IPC::Listener, |
| 108 | public IPC::Sender, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 109 | NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 110 | public RenderWidgetCompositorDelegate, |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 111 | public RenderWidgetInputHandlerDelegate, |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 112 | public RenderWidgetScreenMetricsEmulatorDelegate, |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 113 | public base::RefCounted<RenderWidget> { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 114 | public: |
| 115 | // Creates a new RenderWidget. The opener_id is the routing ID of the |
[email protected] | 38024409 | 2011-10-07 17:26:27 | [diff] [blame] | 116 | // RenderView that this widget lives inside. |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 117 | static RenderWidget* Create(int32_t opener_id, |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 118 | CompositorDependencies* compositor_deps, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 119 | blink::WebPopupType popup_type, |
| 120 | const blink::WebScreenInfo& screen_info); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 121 | |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 122 | // Creates a new RenderWidget that will be attached to a RenderFrame. |
| 123 | static RenderWidget* CreateForFrame(int routing_id, |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 124 | bool hidden, |
| 125 | const blink::WebScreenInfo& screen_info, |
| 126 | CompositorDependencies* compositor_deps, |
| 127 | blink::WebLocalFrame* frame); |
| 128 | |
dcheng | da9b4bb | 2015-07-20 20:58:08 | [diff] [blame] | 129 | // Closes a RenderWidget that was created by |CreateForFrame|. |
dcheng | 3ce04b6 | 2015-10-26 23:30:55 | [diff] [blame] | 130 | // TODO(avi): De-virtualize this once RenderViewImpl has-a RenderWidget. |
| 131 | // https://crbug.com/545684 |
| 132 | virtual void CloseForFrame(); |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 133 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 134 | int32_t routing_id() const { return routing_id_; } |
fsamuel | e8326c74 | 2016-01-12 00:49:39 | [diff] [blame] | 135 | void SetRoutingID(int32_t routing_id); |
| 136 | |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 137 | CompositorDependencies* compositor_deps() const { return compositor_deps_; } |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 138 | blink::WebWidget* webwidget() const { return webwidget_; } |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 139 | const gfx::Size& size() const { return size_; } |
mikhail.pozdnyakov | f2c902a | 2015-04-14 08:09:12 | [diff] [blame] | 140 | bool is_fullscreen_granted() const { return is_fullscreen_granted_; } |
mikhail.pozdnyakov | c0e251b | 2015-04-15 06:51:12 | [diff] [blame] | 141 | blink::WebDisplayMode display_mode() const { return display_mode_; } |
[email protected] | 204f1df | 2012-01-04 20:21:13 | [diff] [blame] | 142 | bool is_hidden() const { return is_hidden_; } |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 143 | // Temporary for debugging purposes... |
| 144 | bool closing() const { return closing_; } |
| 145 | bool is_swapped_out() { return is_swapped_out_; } |
[email protected] | be1af066 | 2014-07-29 19:55:51 | [diff] [blame] | 146 | bool has_host_context_menu_location() { |
| 147 | return has_host_context_menu_location_; |
| 148 | } |
| 149 | gfx::Point host_context_menu_location() { |
| 150 | return host_context_menu_location_; |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 151 | } |
[email protected] | 589621b | 2010-09-23 22:01:07 | [diff] [blame] | 152 | |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 153 | void set_owner_delegate(RenderWidgetOwnerDelegate* owner_delegate) { |
| 154 | DCHECK(!owner_delegate_); |
| 155 | owner_delegate_ = owner_delegate; |
| 156 | } |
| 157 | |
| 158 | RenderWidgetOwnerDelegate* owner_delegate() { return owner_delegate_; } |
| 159 | |
kenrb | a719983 | 2015-01-22 23:44:59 | [diff] [blame] | 160 | // ScreenInfo exposed so it can be passed to subframe RenderWidgets. |
| 161 | blink::WebScreenInfo screen_info() const { return screen_info_; } |
| 162 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 163 | // Functions to track out-of-process frames for special notifications. |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 164 | void RegisterRenderFrameProxy(RenderFrameProxy* proxy); |
| 165 | void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 166 | |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 167 | // Functions to track all RenderFrame objects associated with this |
| 168 | // RenderWidget. |
| 169 | void RegisterRenderFrame(RenderFrameImpl* frame); |
| 170 | void UnregisterRenderFrame(RenderFrameImpl* frame); |
| 171 | |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 172 | #if defined(VIDEO_HOLE) |
| 173 | void RegisterVideoHoleFrame(RenderFrameImpl* frame); |
| 174 | void UnregisterVideoHoleFrame(RenderFrameImpl* frame); |
| 175 | #endif // defined(VIDEO_HOLE) |
| 176 | |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 177 | // IPC::Listener |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 178 | bool OnMessageReceived(const IPC::Message& msg) override; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 179 | |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 180 | // IPC::Sender |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 181 | bool Send(IPC::Message* msg) override; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 182 | |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 183 | // RenderWidgetCompositorDelegate |
| 184 | void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, |
| 185 | const gfx::Vector2dF& outer_delta, |
| 186 | const gfx::Vector2dF& elastic_overscroll_delta, |
| 187 | float page_scale, |
| 188 | float top_controls_delta) override; |
| 189 | void BeginMainFrame(double frame_time_sec) override; |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 190 | std::unique_ptr<cc::OutputSurface> CreateOutputSurface( |
| 191 | bool fallback) override; |
| 192 | std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource() |
| 193 | override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 194 | void DidCommitAndDrawCompositorFrame() override; |
| 195 | void DidCommitCompositorFrame() override; |
| 196 | void DidCompletePageScaleAnimation() override; |
| 197 | void DidCompleteSwapBuffers() override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 198 | void ForwardCompositorProto(const std::vector<uint8_t>& proto) override; |
| 199 | bool IsClosing() const override; |
| 200 | void OnSwapBuffersAborted() override; |
| 201 | void OnSwapBuffersComplete() override; |
| 202 | void OnSwapBuffersPosted() override; |
danakj | 53eccbc | 2016-03-02 22:51:07 | [diff] [blame] | 203 | void RequestScheduleAnimation() override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 204 | void UpdateVisualState() override; |
| 205 | void WillBeginCompositorFrame() override; |
jbroman | 6ccbc7d47 | 2016-07-27 04:45:41 | [diff] [blame] | 206 | std::unique_ptr<cc::SwapPromise> RequestCopyOfOutputForLayoutTest( |
| 207 | std::unique_ptr<cc::CopyOutputRequest> request) override; |
fsamuel | 78f86e4 | 2016-01-20 04:10:23 | [diff] [blame] | 208 | |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 209 | // RenderWidgetInputHandlerDelegate |
| 210 | void FocusChangeComplete() override; |
| 211 | bool HasTouchEventHandlersAt(const gfx::Point& point) const override; |
dtapuska | 1827dd2 | 2016-03-11 15:24:59 | [diff] [blame] | 212 | void ObserveGestureEventAndResult(const blink::WebGestureEvent& gesture_event, |
| 213 | const gfx::Vector2dF& unused_delta, |
| 214 | bool event_processed) override; |
| 215 | |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 216 | void OnDidHandleKeyEvent() override; |
| 217 | void OnDidOverscroll(const DidOverscrollParams& params) override; |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 218 | void OnInputEventAck(std::unique_ptr<InputEventAck> input_event_ack) override; |
dtapuska | b08721e6 | 2016-06-29 03:35:07 | [diff] [blame] | 219 | void NotifyInputEventHandled(blink::WebInputEvent::Type handled_type, |
| 220 | InputEventAckState ack_result) override; |
fsamuel | e8326c74 | 2016-01-12 00:49:39 | [diff] [blame] | 221 | void SetInputHandler(RenderWidgetInputHandler* input_handler) override; |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 222 | void UpdateTextInputState(ShowIme show_ime, |
| 223 | ChangeSource change_source) override; |
| 224 | bool WillHandleGestureEvent(const blink::WebGestureEvent& event) override; |
| 225 | bool WillHandleMouseEvent(const blink::WebMouseEvent& event) override; |
| 226 | |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 227 | // RenderWidgetScreenMetricsDelegate |
| 228 | void Redraw() override; |
| 229 | void Resize(const ResizeParams& resize_params) override; |
| 230 | void SetScreenMetricsEmulationParameters( |
| 231 | bool enabled, |
| 232 | const blink::WebDeviceEmulationParams& params) override; |
| 233 | void SetScreenRects(const gfx::Rect& view_screen_rect, |
| 234 | const gfx::Rect& window_screen_rect) override; |
| 235 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 236 | // blink::WebWidgetClient |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 237 | void initializeLayerTreeView() override; |
| 238 | blink::WebLayerTreeView* layerTreeView() override; |
dglazkov | f0e1d6d | 2015-10-10 02:13:48 | [diff] [blame] | 239 | void didMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 240 | void didChangeCursor(const blink::WebCursorInfo&) override; |
| 241 | void closeWidgetSoon() override; |
| 242 | void show(blink::WebNavigationPolicy) override; |
| 243 | blink::WebRect windowRect() override; |
| 244 | void setToolTipText(const blink::WebString& text, |
| 245 | blink::WebTextDirection hint) override; |
| 246 | void setWindowRect(const blink::WebRect&) override; |
| 247 | blink::WebRect windowResizerRect() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 248 | blink::WebScreenInfo screenInfo() override; |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 249 | void resetInputMethod() override; |
| 250 | void didHandleGestureEvent(const blink::WebGestureEvent& event, |
| 251 | bool event_cancelled) override; |
bokan | e53a10f | 2016-04-13 23:48:31 | [diff] [blame] | 252 | void didOverscroll(const blink::WebFloatSize& overscrollDelta, |
| 253 | const blink::WebFloatSize& accumulatedOverscroll, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 254 | const blink::WebFloatPoint& position, |
| 255 | const blink::WebFloatSize& velocity) override; |
| 256 | void showImeIfNeeded() override; |
oshima | 581cf3f6 | 2015-12-16 20:08:01 | [diff] [blame] | 257 | void convertViewportToWindow(blink::WebRect* rect) override; |
oshima | a6985b6 | 2016-01-27 08:58:30 | [diff] [blame] | 258 | void convertWindowToViewport(blink::WebFloatRect* rect) override; |
lfg | bee1e0a | 2016-06-08 21:24:21 | [diff] [blame] | 259 | bool requestPointerLock() override; |
| 260 | void requestPointerUnlock() override; |
| 261 | bool isPointerLocked() override; |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 262 | |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 263 | // Override point to obtain that the current input method state and caret |
| 264 | // position. |
| 265 | virtual ui::TextInputType GetTextInputType(); |
| 266 | virtual ui::TextInputType WebKitToUiTextInputType( |
| 267 | blink::WebTextInputType type); |
| 268 | |
donnd | a070f3c | 2015-01-16 19:54:11 | [diff] [blame] | 269 | #if defined(OS_ANDROID) |
| 270 | // Notifies that a tap was not consumed, so showing a UI for the unhandled |
| 271 | // tap may be needed. |
donnd | 57e54f5 | 2015-02-26 19:03:37 | [diff] [blame] | 272 | // Performs various checks on the given WebNode to apply heuristics to |
| 273 | // determine if triggering is appropriate. |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 274 | void showUnhandledTapUIIfNeeded(const blink::WebPoint& tapped_position, |
| 275 | const blink::WebNode& tapped_node, |
| 276 | bool page_changed) override; |
donnd | a070f3c | 2015-01-16 19:54:11 | [diff] [blame] | 277 | #endif |
| 278 | |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 279 | // Begins the compositor's scheduler to start producing frames. |
| 280 | void StartCompositor(); |
| 281 | |
[email protected] | aeeedad | 2014-08-22 18:16:22 | [diff] [blame] | 282 | // Stop compositing. |
enne | f3c5814 | 2014-12-09 21:44:38 | [diff] [blame] | 283 | void WillCloseLayerTreeView(); |
[email protected] | aeeedad | 2014-08-22 18:16:22 | [diff] [blame] | 284 | |
[email protected] | 24ed043 | 2013-04-24 07:50:31 | [diff] [blame] | 285 | RenderWidgetCompositor* compositor() const; |
| 286 | |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 287 | const RenderWidgetInputHandler& input_handler() const { |
fsamuel | e8326c74 | 2016-01-12 00:49:39 | [diff] [blame] | 288 | return *input_handler_; |
fsamuel | 72464894f | 2015-12-15 06:59:31 | [diff] [blame] | 289 | } |
| 290 | |
| 291 | void SetHandlingInputEventForTesting(bool handling_input_event); |
| 292 | |
| 293 | // When paused in debugger, we send ack for mouse event early. This ensures |
| 294 | // that we continue receiving mouse moves and pass them to debugger. Returns |
| 295 | // whether we are paused in mouse move event and have sent the ack. |
| 296 | bool SendAckForMouseMoveFromDebugger(); |
| 297 | |
| 298 | // When resumed from pause in debugger while handling mouse move, |
| 299 | // we should not send an extra ack (see SendAckForMouseMoveFromDebugger). |
| 300 | void IgnoreAckForMouseMoveFromDebugger(); |
| 301 | |
[email protected] | 79fa22e | 2013-08-23 15:18:12 | [diff] [blame] | 302 | // Callback for use with synthetic gestures (e.g. BeginSmoothScroll). |
| 303 | typedef base::Callback<void()> SyntheticGestureCompletionCallback; |
[email protected] | 0e241b4b | 2012-08-18 09:06:27 | [diff] [blame] | 304 | |
[email protected] | 9017d785 | 2013-11-21 17:47:35 | [diff] [blame] | 305 | // Send a synthetic gesture to the browser to be queued to the synthetic |
| 306 | // gesture controller. |
| 307 | void QueueSyntheticGesture( |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 308 | std::unique_ptr<SyntheticGestureParams> gesture_params, |
[email protected] | 9017d785 | 2013-11-21 17:47:35 | [diff] [blame] | 309 | const SyntheticGestureCompletionCallback& callback); |
[email protected] | 1e1dd18 | 2013-09-12 01:51:15 | [diff] [blame] | 310 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 311 | // Deliveres |message| together with compositor state change updates. The |
| 312 | // exact behavior depends on |policy|. |
| 313 | // This mechanism is not a drop-in replacement for IPC: messages sent this way |
| 314 | // will not be automatically available to BrowserMessageFilter, for example. |
| 315 | // FIFO ordering is preserved between messages enqueued with the same |
| 316 | // |policy|, the ordering between messages enqueued for different policies is |
| 317 | // undefined. |
| 318 | // |
| 319 | // |msg| message to send, ownership of |msg| is transferred. |
| 320 | // |policy| see the comment on MessageDeliveryPolicy. |
| 321 | void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy); |
| 322 | |
changwan | 8c34274 | 2016-02-26 00:53:39 | [diff] [blame] | 323 | // Check whether IME thread is being used or not. |
| 324 | bool IsUsingImeThread(); |
| 325 | |
changwan | f2a707b | 2015-10-30 08:22:16 | [diff] [blame] | 326 | // Handle start and finish of IME event guard. |
| 327 | void OnImeEventGuardStart(ImeEventGuard* guard); |
| 328 | void OnImeEventGuardFinish(ImeEventGuard* guard); |
[email protected] | 66fca5bc | 2013-05-23 06:58:29 | [diff] [blame] | 329 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 330 | // Returns whether we currently should handle an IME event. |
| 331 | bool ShouldHandleImeEvent(); |
| 332 | |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 333 | void SetPopupOriginAdjustmentsForEmulation( |
| 334 | RenderWidgetScreenMetricsEmulator* emulator); |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 335 | |
[email protected] | 2d6836f4 | 2014-07-02 17:25:31 | [diff] [blame] | 336 | gfx::Rect AdjustValidationMessageAnchor(const gfx::Rect& anchor); |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 337 | |
jdduke | 491a3f0c | 2015-06-15 23:30:26 | [diff] [blame] | 338 | |
| 339 | void ScheduleComposite(); |
[email protected] | 7d08a935 | 2013-10-15 08:24:56 | [diff] [blame] | 340 | void ScheduleCompositeWithForcedRedraw(); |
| 341 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 342 | // Checks if the selection bounds have been changed. If they are changed, |
| 343 | // the new value will be sent to the browser process. |
| 344 | void UpdateSelectionBounds(); |
| 345 | |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 346 | virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end); |
| 347 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 348 | void OnShowHostContextMenu(ContextMenuParams* params); |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 349 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 350 | // Checks if the composition range or composition character bounds have been |
| 351 | // changed. If they are changed, the new value will be sent to the browser |
yukawa | 5f21c6a | 2014-10-27 17:09:30 | [diff] [blame] | 352 | // process. This method does nothing when the browser process is not able to |
| 353 | // handle composition range and composition character bounds. |
nona | fa29179 | 2016-08-10 02:36:18 | [diff] [blame] | 354 | // If immediate_request is true, render sends the latest composition info to |
| 355 | // the browser even if the composition info is not changed. |
| 356 | void UpdateCompositionInfo(bool immediate_request); |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 357 | |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 358 | // Change the device ICC color profile while running a layout test. |
| 359 | void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile); |
| 360 | void ResetDeviceColorProfileForTesting(); |
| 361 | |
lfg | b00fcad | 2016-07-14 14:16:33 | [diff] [blame] | 362 | // Called when the Widget has changed size as a result of an auto-resize. |
| 363 | void DidAutoResize(const gfx::Size& new_size); |
| 364 | |
lfg | 0140a45 | 2016-07-19 19:15:05 | [diff] [blame] | 365 | // Called to get the position of the root window containing the widget in |
| 366 | // screen coordinates. |
| 367 | gfx::Rect RootWindowRect(); |
| 368 | |
lfg | e0c2792ec | 2016-05-11 18:52:08 | [diff] [blame] | 369 | // Indicates whether this widget has focus. |
| 370 | bool has_focus() const { return has_focus_; } |
| 371 | |
lfg | bee1e0a | 2016-06-08 21:24:21 | [diff] [blame] | 372 | MouseLockDispatcher* mouse_lock_dispatcher() { |
| 373 | return mouse_lock_dispatcher_.get(); |
| 374 | } |
| 375 | |
ekaramad | 2a46d63 | 2016-07-19 13:33:09 | [diff] [blame] | 376 | void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) { |
| 377 | focused_pepper_plugin_ = plugin; |
| 378 | } |
| 379 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 380 | protected: |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 381 | // Friend RefCounted so that the dtor can be non-public. Using this class |
| 382 | // without ref-counting is an error. |
| 383 | friend class base::RefCounted<RenderWidget>; |
fsamuel | e8326c74 | 2016-01-12 00:49:39 | [diff] [blame] | 384 | |
[email protected] | 7339cd2 | 2010-10-27 00:11:20 | [diff] [blame] | 385 | // For unit tests. |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 386 | friend class RenderWidgetTest; |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 387 | |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 388 | enum ResizeAck { |
| 389 | SEND_RESIZE_ACK, |
| 390 | NO_RESIZE_ACK, |
| 391 | }; |
| 392 | |
dcheng | 35d31c11 | 2015-07-22 00:17:36 | [diff] [blame] | 393 | RenderWidget(CompositorDependencies* compositor_deps, |
| 394 | blink::WebPopupType popup_type, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 395 | const blink::WebScreenInfo& screen_info, |
[email protected] | 1ac10dca | 2013-08-20 20:47:04 | [diff] [blame] | 396 | bool swapped_out, |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 397 | bool hidden, |
| 398 | bool never_visible); |
[email protected] | ce2b28e | 2012-08-09 15:53:57 | [diff] [blame] | 399 | |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 400 | ~RenderWidget() override; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 401 | |
lfg | caab514 | 2016-02-26 19:06:52 | [diff] [blame] | 402 | static blink::WebFrameWidget* CreateWebFrameWidget( |
| 403 | RenderWidget* render_widget, |
| 404 | blink::WebLocalFrame* frame); |
dcheng | da9b4bb | 2015-07-20 20:58:08 | [diff] [blame] | 405 | |
| 406 | // Creates a WebWidget based on the popup type. |
| 407 | static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); |
| 408 | |
piman | c4af307 | 2015-10-02 03:45:59 | [diff] [blame] | 409 | // Initializes this view with the given opener. |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 410 | bool Init(int32_t opener_id); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 411 | |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 412 | // Called by Init and subclasses to perform initialization. |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 413 | bool DoInit(int32_t opener_id, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 414 | blink::WebWidget* web_widget, |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 415 | IPC::SyncMessage* create_widget_message); |
| 416 | |
[email protected] | 992db4c | 2011-05-12 15:37:15 | [diff] [blame] | 417 | // Sets whether this RenderWidget has been swapped out to be displayed by |
| 418 | // a RenderWidget in a different process. If so, no new IPC messages will be |
| 419 | // sent (only ACKs) and the process is free to exit when there are no other |
| 420 | // active RenderWidgets. |
| 421 | void SetSwappedOut(bool is_swapped_out); |
| 422 | |
[email protected] | 949b659 | 2014-08-20 13:17:52 | [diff] [blame] | 423 | // Allows the process to exit once the unload handler has finished, if there |
| 424 | // are no other active RenderWidgets. |
| 425 | void WasSwappedOut(); |
| 426 | |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 427 | void DoDeferredClose(); |
dgozman | cf9039cd | 2015-04-06 12:01:31 | [diff] [blame] | 428 | void NotifyOnClose(); |
dcheng | da9b4bb | 2015-07-20 20:58:08 | [diff] [blame] | 429 | |
bokan | c63441c | 2016-04-27 15:49:12 | [diff] [blame] | 430 | gfx::Size GetSizeForWebWidget() const; |
| 431 | virtual void ResizeWebWidget(); |
| 432 | |
dcheng | da9b4bb | 2015-07-20 20:58:08 | [diff] [blame] | 433 | // Close the underlying WebWidget. |
| 434 | virtual void Close(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 435 | |
[email protected] | 9265016 | 2013-10-30 03:31:02 | [diff] [blame] | 436 | // Used to force the size of a window when running layout tests. |
bokan | c007c3a | 2015-02-03 07:15:56 | [diff] [blame] | 437 | void SetWindowRectSynchronously(const gfx::Rect& new_window_rect); |
haibinlu | c643d33c | 2016-06-03 02:22:34 | [diff] [blame] | 438 | #if defined(USE_EXTERNAL_POPUP_MENU) |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 439 | void SetExternalPopupOriginAdjustmentsForEmulation( |
mfomitchev | 2600fd7c | 2016-02-17 20:53:39 | [diff] [blame] | 440 | ExternalPopupMenu* popup, |
| 441 | RenderWidgetScreenMetricsEmulator* emulator); |
[email protected] | 5390786 | 2014-03-25 15:42:40 | [diff] [blame] | 442 | #endif |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 443 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 444 | // RenderWidget IPC message handlers |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 445 | void OnHandleInputEvent(const blink::WebInputEvent* event, |
dtapuska | 0bd451a | 2016-02-18 17:08:10 | [diff] [blame] | 446 | const ui::LatencyInfo& latency_info, |
| 447 | InputEventDispatchType dispatch_type); |
[email protected] | 34202de | 2013-05-06 23:36:22 | [diff] [blame] | 448 | void OnCursorVisibilityChange(bool is_visible); |
[email protected] | c084330e0 | 2013-04-27 01:08:15 | [diff] [blame] | 449 | void OnMouseCaptureLost(); |
| 450 | virtual void OnSetFocus(bool enable); |
nasko | c288745f | 2015-05-01 22:54:21 | [diff] [blame] | 451 | void OnClose(); |
[email protected] | fc4404d | 2012-11-07 19:53:30 | [diff] [blame] | 452 | void OnCreatingNewAck(); |
fsamuel | 664e8b6 | 2016-01-20 19:54:01 | [diff] [blame] | 453 | virtual void OnResize(const ResizeParams& params); |
dgozman | 9260b0a1 | 2015-03-16 13:45:20 | [diff] [blame] | 454 | void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params); |
| 455 | void OnDisableDeviceEmulation(); |
[email protected] | b5913d7 | 2012-02-07 22:26:54 | [diff] [blame] | 456 | void OnChangeResizeRect(const gfx::Rect& resizer_rect); |
[email protected] | 941e455 | 2010-02-01 21:23:43 | [diff] [blame] | 457 | virtual void OnWasHidden(); |
[email protected] | 3399dd82 | 2014-08-09 11:14:24 | [diff] [blame] | 458 | virtual void OnWasShown(bool needs_repainting, |
| 459 | const ui::LatencyInfo& latency_info); |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 460 | void OnCreateVideoAck(int32_t video_id); |
| 461 | void OnUpdateVideoAck(int32_t video_id); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 462 | void OnRequestMoveAck(); |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 463 | virtual void OnImeSetComposition( |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 464 | const base::string16& text, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 465 | const std::vector<blink::WebCompositionUnderline>& underlines, |
chongz | 7eb75280 | 2016-01-27 21:28:07 | [diff] [blame] | 466 | const gfx::Range& replacement_range, |
[email protected] | fa7b1dc | 2010-06-23 17:53:04 | [diff] [blame] | 467 | int selection_start, |
| 468 | int selection_end); |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 469 | virtual void OnImeConfirmComposition(const base::string16& text, |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 470 | const gfx::Range& replacement_range, |
[email protected] | 0e45bd0 | 2013-07-12 20:20:02 | [diff] [blame] | 471 | bool keep_selection); |
oshima | d527903 | 2015-12-16 18:22:33 | [diff] [blame] | 472 | // Called when the device scale factor is changed, or the layer tree is |
| 473 | // initialized. |
| 474 | virtual void OnDeviceScaleFactorChanged(); |
| 475 | |
[email protected] | 0bc1f57 | 2013-04-17 01:46:31 | [diff] [blame] | 476 | void OnRepaint(gfx::Size size_to_paint); |
[email protected] | 79fa22e | 2013-08-23 15:18:12 | [diff] [blame] | 477 | void OnSyntheticGestureCompleted(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 478 | void OnSetTextDirection(blink::WebTextDirection direction); |
[email protected] | 872ae5b | 2011-05-26 20:20:50 | [diff] [blame] | 479 | void OnGetFPS(); |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 480 | void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
| 481 | const gfx::Rect& window_screen_rect); |
lfg | db5c4ed | 2016-03-04 23:09:07 | [diff] [blame] | 482 | void OnUpdateWindowScreenRect(const gfx::Rect& window_screen_rect); |
[email protected] | 2384b6c | 2013-02-28 23:58:51 | [diff] [blame] | 483 | void OnShowImeIfNeeded(); |
fsamuel | 27866427 | 2016-07-13 04:06:59 | [diff] [blame] | 484 | void OnSetSurfaceClientId(uint32_t surface_id_namespace); |
dtrainor | 5ef644e | 2015-11-19 00:12:47 | [diff] [blame] | 485 | void OnHandleCompositorProto(const std::vector<uint8_t>& proto); |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 486 | |
[email protected] | adb36231 | 2014-06-28 06:04:24 | [diff] [blame] | 487 | #if defined(OS_ANDROID) |
changwan | 3a84116 | 2015-08-11 02:53:37 | [diff] [blame] | 488 | // Called when we send IME event that expects an ACK. |
| 489 | void OnImeEventSentForAck(const blink::WebTextInputInfo& info); |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 490 | |
| 491 | // Called by the browser process for every required IME acknowledgement. |
| 492 | void OnImeEventAck(); |
changwan | 8c34274 | 2016-02-26 00:53:39 | [diff] [blame] | 493 | |
| 494 | // Called by the browser process to update text input state. |
| 495 | void OnRequestTextInputStateUpdate(); |
[email protected] | 105dffb4 | 2013-02-20 03:46:21 | [diff] [blame] | 496 | #endif |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 497 | |
nona | fa29179 | 2016-08-10 02:36:18 | [diff] [blame] | 498 | // Called by the browser process to update the cursor and composition |
| 499 | // information. |
| 500 | void OnRequestCompositionUpdate(bool immediate_request, bool monitor_request); |
| 501 | |
[email protected] | 847a258 | 2013-03-09 02:29:51 | [diff] [blame] | 502 | // Notify the compositor about a change in viewport size. This should be |
| 503 | // used only with auto resize mode WebWidgets, as normal WebWidgets should |
| 504 | // go through OnResize. |
[email protected] | 97e1bf7 | 2013-03-06 14:06:05 | [diff] [blame] | 505 | void AutoResizeCompositor(); |
| 506 | |
[email protected] | 468ac58 | 2012-11-20 00:53:19 | [diff] [blame] | 507 | virtual void SetDeviceScaleFactor(float device_scale_factor); |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 508 | bool SetDeviceColorProfile(const std::vector<char>& color_profile); |
[email protected] | 468ac58 | 2012-11-20 00:53:19 | [diff] [blame] | 509 | |
[email protected] | fcdc564 | 2014-05-09 14:32:24 | [diff] [blame] | 510 | virtual void OnOrientationChange(); |
| 511 | |
[email protected] | 29ed96a | 2012-02-04 18:12:16 | [diff] [blame] | 512 | // Override points to notify derived classes that a paint has happened. |
[email protected] | 0704ac3 | 2013-10-03 15:24:22 | [diff] [blame] | 513 | // DidInitiatePaint happens when that has completed, and subsequent rendering |
| 514 | // won't affect the painted content. DidFlushPaint happens once we've received |
| 515 | // the ACK that the screen has been updated. For a given paint operation, |
| 516 | // these overrides will always be called in the order DidInitiatePaint, |
| 517 | // DidFlushPaint. |
lfg | e0c2792ec | 2016-05-11 18:52:08 | [diff] [blame] | 518 | virtual void DidInitiatePaint() {} |
avi | b9dbd97 | 2016-03-08 18:19:32 | [diff] [blame] | 519 | virtual void DidFlushPaint(); |
[email protected] | a2f6bc11 | 2009-06-27 16:27:25 | [diff] [blame] | 520 | |
[email protected] | ed7defa | 2013-03-12 21:29:59 | [diff] [blame] | 521 | virtual GURL GetURLForGraphicsContext3D(); |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 522 | |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 523 | // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
| 524 | // use this method so that we can properly inform the RenderThread of our |
| 525 | // state. |
| 526 | void SetHidden(bool hidden); |
| 527 | |
[email protected] | 2b624c56 | 2011-10-27 22:58:26 | [diff] [blame] | 528 | void DidToggleFullscreen(); |
| 529 | |
[email protected] | 67474193 | 2009-02-04 23:44:46 | [diff] [blame] | 530 | bool next_paint_is_resize_ack() const; |
[email protected] | 67474193 | 2009-02-04 23:44:46 | [diff] [blame] | 531 | void set_next_paint_is_resize_ack(); |
[email protected] | 67474193 | 2009-02-04 23:44:46 | [diff] [blame] | 532 | void set_next_paint_is_repaint_ack(); |
[email protected] | ec7dc11 | 2008-08-06 05:30:12 | [diff] [blame] | 533 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 534 | // QueueMessage implementation extracted into a static method for easy |
| 535 | // testing. |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 536 | static std::unique_ptr<cc::SwapPromise> QueueMessageImpl( |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 537 | IPC::Message* msg, |
| 538 | MessageDeliveryPolicy policy, |
| 539 | FrameSwapMessageQueue* frame_swap_message_queue, |
| 540 | scoped_refptr<IPC::SyncMessageFilter> sync_message_filter, |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 541 | int source_frame_number); |
| 542 | |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 543 | // Override point to obtain that the current composition character bounds. |
| 544 | // In the case of surrogate pairs, the character is treated as two characters: |
| 545 | // the bounds for first character is actual one, and the bounds for second |
| 546 | // character is zero width rectangle. |
| 547 | virtual void GetCompositionCharacterBounds( |
| 548 | std::vector<gfx::Rect>* character_bounds); |
| 549 | |
[email protected] | 88dbe32f | 2013-06-20 23:31:36 | [diff] [blame] | 550 | // Returns the range of the text that is being composed or the selection if |
| 551 | // the composition does not exist. |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 552 | virtual void GetCompositionRange(gfx::Range* range); |
[email protected] | 88dbe32f | 2013-06-20 23:31:36 | [diff] [blame] | 553 | |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 554 | // Returns true if the composition range or composition character bounds |
| 555 | // should be sent to the browser process. |
| 556 | bool ShouldUpdateCompositionInfo( |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 557 | const gfx::Range& range, |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 558 | const std::vector<gfx::Rect>& bounds); |
| 559 | |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 560 | // Override point to obtain that the current input method state about |
| 561 | // composition text. |
| 562 | virtual bool CanComposeInline(); |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 563 | |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 564 | // Set the pending window rect. |
| 565 | // Because the real render_widget is hosted in another process, there is |
| 566 | // a time period where we may have set a new window rect which has not yet |
| 567 | // been processed by the browser. So we maintain a pending window rect |
| 568 | // size. If JS code sets the WindowRect, and then immediately calls |
| 569 | // GetWindowRect() we'll use this pending window rect as the size. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 570 | void SetPendingWindowRect(const blink::WebRect& r); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 571 | |
[email protected] | ce6689f | 2013-03-29 12:52:55 | [diff] [blame] | 572 | // Check whether the WebWidget has any touch event handlers registered. |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 573 | void hasTouchEventHandlers(bool has_handlers) override; |
[email protected] | ce6689f | 2013-03-29 12:52:55 | [diff] [blame] | 574 | |
[email protected] | 5d0bbdfa9 | 2013-12-10 00:35:51 | [diff] [blame] | 575 | // Tell the browser about the actions permitted for a new touch point. |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 576 | void setTouchAction(blink::WebTouchAction touch_action) override; |
[email protected] | 5d0bbdfa9 | 2013-12-10 00:35:51 | [diff] [blame] | 577 | |
[email protected] | 90f2415 | 2014-04-09 12:41:36 | [diff] [blame] | 578 | // Called when value of focused text field gets dirty, e.g. value is modified |
| 579 | // by script, not by user input. |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 580 | void didUpdateTextOfFocusedElementByNonUserInput() override; |
[email protected] | 90f2415 | 2014-04-09 12:41:36 | [diff] [blame] | 581 | |
lfg | 43e08e6 | 2016-02-03 18:51:37 | [diff] [blame] | 582 | // Sends an ACK to the browser process during the next compositor frame. |
| 583 | void OnWaitNextFrameForTests(int routing_id); |
| 584 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 585 | // Routing ID that allows us to communicate to the parent browser process |
| 586 | // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 587 | int32_t routing_id_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 588 | |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 589 | // Dependencies for initializing a compositor, including flags for optional |
| 590 | // features. |
dcheng | 35d31c11 | 2015-07-22 00:17:36 | [diff] [blame] | 591 | CompositorDependencies* const compositor_deps_; |
danakj | 6e3bf801 | 2014-12-16 18:27:53 | [diff] [blame] | 592 | |
[email protected] | c5b3b5e | 2009-02-13 06:41:11 | [diff] [blame] | 593 | // We are responsible for destroying this object via its Close method. |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 594 | // May be NULL when the window is closing. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 595 | blink::WebWidget* webwidget_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 596 | |
avi | 40b5be7a | 2016-03-03 21:13:44 | [diff] [blame] | 597 | // The delegate of the owner of this object. |
| 598 | RenderWidgetOwnerDelegate* owner_delegate_; |
| 599 | |
[email protected] | 8926c60 | 2013-01-23 05:32:06 | [diff] [blame] | 600 | // This is lazily constructed and must not outlive webwidget_. |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 601 | std::unique_ptr<RenderWidgetCompositor> compositor_; |
[email protected] | 8926c60 | 2013-01-23 05:32:06 | [diff] [blame] | 602 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 603 | // Set to the ID of the view that initiated creating this view, if any. When |
| 604 | // the view was initiated by the browser (the common case), this will be |
| 605 | // MSG_ROUTING_NONE. This is used in determining ownership when opening |
| 606 | // child tabs. See RenderWidget::createWebViewWithRequest. |
| 607 | // |
| 608 | // This ID may refer to an invalid view if that view is closed before this |
| 609 | // view is. |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 610 | int32_t opener_id_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 611 | |
bokan | c007c3a | 2015-02-03 07:15:56 | [diff] [blame] | 612 | // The rect where this view should be initially shown. |
| 613 | gfx::Rect initial_rect_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 614 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 615 | // We store the current cursor object so we can avoid spamming SetCursor |
| 616 | // messages. |
| 617 | WebCursor current_cursor_; |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 618 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 619 | // The size of the RenderWidget. |
| 620 | gfx::Size size_; |
| 621 | |
[email protected] | 60d47ac | 2013-03-01 23:42:44 | [diff] [blame] | 622 | // The size of the view's backing surface in non-DPI-adjusted pixels. |
| 623 | gfx::Size physical_backing_size_; |
| 624 | |
[email protected] | bb6378fe | 2014-04-28 21:19:44 | [diff] [blame] | 625 | // The size of the visible viewport in DPI-adjusted pixels. |
| 626 | gfx::Size visible_viewport_size_; |
| 627 | |
[email protected] | f21c613a | 2009-02-12 14:46:17 | [diff] [blame] | 628 | // The area that must be reserved for drawing the resize corner. |
| 629 | gfx::Rect resizer_rect_; |
| 630 | |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 631 | // Flags for the next ViewHostMsg_UpdateRect message. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 632 | int next_paint_flags_; |
| 633 | |
[email protected] | 847a258 | 2013-03-09 02:29:51 | [diff] [blame] | 634 | // Whether the WebWidget is in auto resize mode, which is used for example |
| 635 | // by extension popups. |
| 636 | bool auto_resize_mode_; |
| 637 | |
[email protected] | ea3ee0a | 2012-05-15 03:43:09 | [diff] [blame] | 638 | // True if we need to send an UpdateRect message to notify the browser about |
| 639 | // an already-completed auto-resize. |
| 640 | bool need_update_rect_for_auto_resize_; |
| 641 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 642 | // Set to true if we should ignore RenderWidget::Show calls. |
| 643 | bool did_show_; |
| 644 | |
| 645 | // Indicates that we shouldn't bother generated paint events. |
| 646 | bool is_hidden_; |
| 647 | |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 648 | // Indicates that we are never visible, so never produce graphical output. |
sievers | 71c62dd5 | 2015-10-07 01:44:39 | [diff] [blame] | 649 | const bool compositor_never_visible_; |
[email protected] | 7912e82 | 2014-04-16 02:37:03 | [diff] [blame] | 650 | |
mikhail.pozdnyakov | f2c902a | 2015-04-14 08:09:12 | [diff] [blame] | 651 | // Indicates whether tab-initiated fullscreen was granted. |
| 652 | bool is_fullscreen_granted_; |
[email protected] | ee41e7d2 | 2011-10-14 19:34:09 | [diff] [blame] | 653 | |
mikhail.pozdnyakov | c0e251b | 2015-04-15 06:51:12 | [diff] [blame] | 654 | // Indicates the display mode. |
| 655 | blink::WebDisplayMode display_mode_; |
| 656 | |
changwan | f2a707b | 2015-10-30 08:22:16 | [diff] [blame] | 657 | // It is possible that one ImeEventGuard is nested inside another |
| 658 | // ImeEventGuard. We keep track of the outermost one, and update it as needed. |
| 659 | ImeEventGuard* ime_event_guard_; |
[email protected] | e8f775f | 2013-02-14 21:00:50 | [diff] [blame] | 660 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 661 | // True if we have requested this widget be closed. No more messages will |
| 662 | // be sent, except for a Close. |
| 663 | bool closing_; |
| 664 | |
[email protected] | aeeedad | 2014-08-22 18:16:22 | [diff] [blame] | 665 | // True if it is known that the host is in the process of being shut down. |
| 666 | bool host_closing_; |
| 667 | |
[email protected] | 992db4c | 2011-05-12 15:37:15 | [diff] [blame] | 668 | // Whether this RenderWidget is currently swapped out, such that the view is |
| 669 | // being rendered by another process. If all RenderWidgets in a process are |
| 670 | // swapped out, the process can exit. |
| 671 | bool is_swapped_out_; |
| 672 | |
simonhong | 628f981 | 2015-04-27 23:13:20 | [diff] [blame] | 673 | // Whether this RenderWidget is for an out-of-process iframe or not. |
| 674 | bool for_oopif_; |
| 675 | |
[email protected] | 5b739cb | 2012-08-21 20:35:21 | [diff] [blame] | 676 | // Stores information about the current text input. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 677 | blink::WebTextInputInfo text_input_info_; |
[email protected] | 5b739cb | 2012-08-21 20:35:21 | [diff] [blame] | 678 | |
[email protected] | fa7b1dc | 2010-06-23 17:53:04 | [diff] [blame] | 679 | // Stores the current text input type of |webwidget_|. |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 680 | ui::TextInputType text_input_type_; |
| 681 | |
[email protected] | b256eca | 2013-07-11 10:57:40 | [diff] [blame] | 682 | // Stores the current text input mode of |webwidget_|. |
| 683 | ui::TextInputMode text_input_mode_; |
| 684 | |
shuchen | 82ce8c5 | 2014-10-23 01:55:20 | [diff] [blame] | 685 | // Stores the current text input flags of |webwidget_|. |
| 686 | int text_input_flags_; |
| 687 | |
[email protected] | 86ba5fcb | 2013-09-04 00:36:53 | [diff] [blame] | 688 | // Stores the current type of composition text rendering of |webwidget_|. |
| 689 | bool can_compose_inline_; |
| 690 | |
[email protected] | e99ef6f | 2011-10-16 01:13:00 | [diff] [blame] | 691 | // Stores the current selection bounds. |
[email protected] | 7c8873e | 2013-02-05 08:03:01 | [diff] [blame] | 692 | gfx::Rect selection_focus_rect_; |
| 693 | gfx::Rect selection_anchor_rect_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 694 | |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 695 | // Stores the current composition character bounds. |
| 696 | std::vector<gfx::Rect> composition_character_bounds_; |
| 697 | |
| 698 | // Stores the current composition range. |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 699 | gfx::Range composition_range_; |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 700 | |
[email protected] | 3e2b375b | 2010-04-07 17:03:12 | [diff] [blame] | 701 | // The kind of popup this widget represents, NONE if not a popup. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 702 | blink::WebPopupType popup_type_; |
[email protected] | 0ebf387 | 2008-11-07 21:35:03 | [diff] [blame] | 703 | |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 704 | // While we are waiting for the browser to update window sizes, we track the |
| 705 | // pending size temporarily. |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 706 | int pending_window_rect_count_; |
lfg | 0140a45 | 2016-07-19 19:15:05 | [diff] [blame] | 707 | gfx::Rect pending_window_rect_; |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 708 | |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 709 | // The screen rects of the view and the window that contains it. |
| 710 | gfx::Rect view_screen_rect_; |
| 711 | gfx::Rect window_screen_rect_; |
| 712 | |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 713 | std::unique_ptr<RenderWidgetInputHandler> input_handler_; |
[email protected] | 12fbad81 | 2009-09-01 18:21:24 | [diff] [blame] | 714 | |
[email protected] | fd84779 | 2013-10-24 17:12:35 | [diff] [blame] | 715 | // The time spent in input handlers this frame. Used to throttle input acks. |
| 716 | base::TimeDelta total_input_handling_time_this_frame_; |
| 717 | |
[email protected] | 842f1065 | 2012-06-06 01:54:04 | [diff] [blame] | 718 | // Properties of the screen hosting this RenderWidget instance. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 719 | blink::WebScreenInfo screen_info_; |
[email protected] | 842f1065 | 2012-06-06 01:54:04 | [diff] [blame] | 720 | |
[email protected] | f1cccb3 | 2012-06-06 18:29:59 | [diff] [blame] | 721 | // The device scale factor. This value is computed from the DPI entries in |
| 722 | // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
[email protected] | faec7b1 | 2012-06-19 14:42:13 | [diff] [blame] | 723 | float device_scale_factor_; |
[email protected] | f1cccb3 | 2012-06-06 18:29:59 | [diff] [blame] | 724 | |
[email protected] | 28ed6b3 | 2014-06-08 02:16:27 | [diff] [blame] | 725 | // The device color profile on supported platforms. |
| 726 | std::vector<char> device_color_profile_; |
| 727 | |
[email protected] | 9017d785 | 2013-11-21 17:47:35 | [diff] [blame] | 728 | // State associated with synthetic gestures. Synthetic gestures are processed |
| 729 | // in-order, so a queue is sufficient to identify the correct state for a |
| 730 | // completed gesture. |
| 731 | std::queue<SyntheticGestureCompletionCallback> |
| 732 | pending_synthetic_gesture_callbacks_; |
[email protected] | 0e241b4b | 2012-08-18 09:06:27 | [diff] [blame] | 733 | |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 734 | #if defined(OS_ANDROID) |
[email protected] | 90f2415 | 2014-04-09 12:41:36 | [diff] [blame] | 735 | // Indicates value in the focused text field is in dirty state, i.e. modified |
| 736 | // by script etc., not by user input. |
| 737 | bool text_field_is_dirty_; |
| 738 | |
changwan | 3a84116 | 2015-08-11 02:53:37 | [diff] [blame] | 739 | // Stores the history of text input infos from the last ACK'ed one from the |
| 740 | // current one. The size is the number of pending ACKs plus one, since we |
| 741 | // intentionally keep the last ack'd value to know what the browser is |
| 742 | // currently aware of. |
| 743 | std::deque<blink::WebTextInputInfo> text_input_info_history_; |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 744 | #endif |
| 745 | |
nona | fa29179 | 2016-08-10 02:36:18 | [diff] [blame] | 746 | // True if the IME requests updated composition info. |
| 747 | bool monitor_composition_info_; |
| 748 | |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 749 | std::unique_ptr<RenderWidgetScreenMetricsEmulator> screen_metrics_emulator_; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 750 | |
| 751 | // Popups may be displaced when screen metrics emulation is enabled. |
| 752 | // These values are used to properly adjust popup position. |
danakj | 2ef31b8 | 2015-10-21 18:18:02 | [diff] [blame] | 753 | gfx::Point popup_view_origin_for_emulation_; |
| 754 | gfx::Point popup_screen_origin_for_emulation_; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 755 | float popup_origin_scale_for_emulation_; |
| 756 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 757 | scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 758 | std::unique_ptr<ResizingModeSelector> resizing_mode_selector_; |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 759 | |
[email protected] | e3244ed | 2014-06-20 20:04:27 | [diff] [blame] | 760 | // Lists of RenderFrameProxy objects that need to be notified of |
| 761 | // compositing-related events (e.g. DidCommitCompositorFrame). |
brettw | 236d317 | 2015-06-03 16:31:43 | [diff] [blame] | 762 | base::ObserverList<RenderFrameProxy> render_frame_proxies_; |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 763 | #if defined(VIDEO_HOLE) |
brettw | 236d317 | 2015-06-03 16:31:43 | [diff] [blame] | 764 | base::ObserverList<RenderFrameImpl> video_hole_frames_; |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 765 | #endif // defined(VIDEO_HOLE) |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 766 | |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 767 | // A list of RenderFrames associated with this RenderWidget. Notifications |
| 768 | // are sent to each frame in the list for events such as changing |
| 769 | // visibility state for example. |
brettw | 236d317 | 2015-06-03 16:31:43 | [diff] [blame] | 770 | base::ObserverList<RenderFrameImpl> render_frames_; |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 771 | |
[email protected] | be1af066 | 2014-07-29 19:55:51 | [diff] [blame] | 772 | bool has_host_context_menu_location_; |
| 773 | gfx::Point host_context_menu_location_; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 774 | |
skyostil | 529caa29 | 2016-08-10 17:44:51 | [diff] [blame^] | 775 | std::unique_ptr<blink::scheduler::RenderWidgetSchedulingState> |
alexclarke | 7fa9394 | 2015-10-21 15:37:11 | [diff] [blame] | 776 | render_widget_scheduling_state_; |
| 777 | |
lfg | bee1e0a | 2016-06-08 21:24:21 | [diff] [blame] | 778 | // Mouse Lock dispatcher attached to this view. |
| 779 | std::unique_ptr<RenderWidgetMouseLockDispatcher> mouse_lock_dispatcher_; |
| 780 | |
| 781 | // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
| 782 | std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
| 783 | |
oshima | 50872a7 | 2016-03-04 13:26:18 | [diff] [blame] | 784 | private: |
| 785 | // When emulated, this returns original device scale factor. |
| 786 | float GetOriginalDeviceScaleFactor() const; |
| 787 | |
lfg | e0c2792ec | 2016-05-11 18:52:08 | [diff] [blame] | 788 | // Indicates whether this widget has focus. |
| 789 | bool has_focus_; |
| 790 | |
ekaramad | 2a46d63 | 2016-07-19 13:33:09 | [diff] [blame] | 791 | // This reference is set by the RenderFrame and is used to query the IME- |
| 792 | // related state from the plugin to later send to the browser. |
| 793 | PepperPluginInstanceImpl* focused_pepper_plugin_; |
| 794 | |
[email protected] | 05d47875 | 2009-04-08 23:38:16 | [diff] [blame] | 795 | DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 796 | }; |
| 797 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 798 | } // namespace content |
| 799 | |
[email protected] | 2cff005 | 2011-03-18 16:51:44 | [diff] [blame] | 800 | #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |