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