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