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