[email protected] | 9f4f332 | 2012-01-18 22:29:56 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | 2cff005 | 2011-03-18 16:51:44 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 | #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 7 | |
[email protected] | aa4117f | 2011-12-09 22:19:21 | [diff] [blame] | 8 | #include <deque> |
[email protected] | 0e241b4b | 2012-08-18 09:06:27 | [diff] [blame] | 9 | #include <map> |
[email protected] | 010ea08a | 2009-10-11 20:21:32 | [diff] [blame] | 10 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 11 | #include "base/basictypes.h" |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 12 | #include "base/compiler_specific.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 13 | #include "base/memory/ref_counted.h" |
[email protected] | 8704f89b | 2011-04-15 00:30:05 | [diff] [blame] | 14 | #include "base/memory/scoped_ptr.h" |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 15 | #include "base/observer_list.h" |
[email protected] | abb52216 | 2013-06-28 01:54:16 | [diff] [blame] | 16 | #include "base/time/time.h" |
| 17 | #include "base/timer/timer.h" |
[email protected] | c1e6cc06 | 2013-08-24 03:35:35 | [diff] [blame] | 18 | #include "cc/debug/rendering_stats_instrumentation.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] | 921f159 | 2011-03-18 00:41:02 | [diff] [blame] | 23 | #include "content/renderer/paint_aggregator.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" |
| 28 | #include "third_party/WebKit/public/web/WebPopupType.h" |
| 29 | #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 30 | #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
[email protected] | 5d0bbdfa9 | 2013-12-10 00:35:51 | [diff] [blame] | 31 | #include "third_party/WebKit/public/web/WebTouchAction.h" |
[email protected] | 0e45bd0 | 2013-07-12 20:20:02 | [diff] [blame] | 32 | #include "third_party/WebKit/public/web/WebWidget.h" |
[email protected] | 2255a933 | 2013-06-17 05:12:31 | [diff] [blame] | 33 | #include "third_party/WebKit/public/web/WebWidgetClient.h" |
[email protected] | d65adb1 | 2010-04-28 17:26:49 | [diff] [blame] | 34 | #include "third_party/skia/include/core/SkBitmap.h" |
[email protected] | b256eca | 2013-07-11 10:57:40 | [diff] [blame] | 35 | #include "ui/base/ime/text_input_mode.h" |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 36 | #include "ui/base/ime/text_input_type.h" |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 37 | #include "ui/base/ui_base_types.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 38 | #include "ui/gfx/native_widget_types.h" |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 39 | #include "ui/gfx/range/range.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 40 | #include "ui/gfx/rect.h" |
[email protected] | 990278ff | 2012-11-13 02:12:55 | [diff] [blame] | 41 | #include "ui/gfx/vector2d.h" |
[email protected] | a2b5ded | 2013-05-20 21:32:53 | [diff] [blame] | 42 | #include "ui/gfx/vector2d_f.h" |
[email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 43 | #include "ui/surface/transport_dib.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 44 | |
[email protected] | aa4117f | 2011-12-09 22:19:21 | [diff] [blame] | 45 | struct ViewHostMsg_UpdateRect_Params; |
[email protected] | 0fdd501 | 2013-05-29 08:05:56 | [diff] [blame] | 46 | struct ViewMsg_Resize_Params; |
[email protected] | aa4117f | 2011-12-09 22:19:21 | [diff] [blame] | 47 | class ViewHostMsg_UpdateRect; |
| 48 | |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 49 | namespace IPC { |
| 50 | class SyncMessage; |
| 51 | } |
| 52 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 53 | namespace blink { |
[email protected] | 1919368 | 2014-04-03 15:01:43 | [diff] [blame] | 54 | struct WebDeviceEmulationParams; |
[email protected] | 41d8685 | 2012-11-07 12:23:24 | [diff] [blame] | 55 | class WebGestureEvent; |
[email protected] | 0dea165 | 2012-12-14 00:09:09 | [diff] [blame] | 56 | class WebInputEvent; |
[email protected] | f56c787 | 2013-06-18 12:31:57 | [diff] [blame] | 57 | class WebKeyboardEvent; |
[email protected] | 6a8ddba5 | 2010-09-05 04:38:06 | [diff] [blame] | 58 | class WebMouseEvent; |
[email protected] | 2d0f2e9 | 2011-10-03 09:02:24 | [diff] [blame] | 59 | class WebTouchEvent; |
[email protected] | 52647690 | 2011-10-06 20:34:06 | [diff] [blame] | 60 | } |
| 61 | |
[email protected] | ba91a79 | 2013-02-06 09:48:28 | [diff] [blame] | 62 | namespace cc { class OutputSurface; } |
| 63 | |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 64 | namespace gfx { |
[email protected] | 4de6d169 | 2011-10-12 08:45:44 | [diff] [blame] | 65 | class Range; |
| 66 | } |
| 67 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 68 | namespace content { |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 69 | class ExternalPopupMenu; |
[email protected] | adab233 | 2013-07-25 18:04:32 | [diff] [blame] | 70 | class PepperPluginInstanceImpl; |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 71 | class RenderFrameImpl; |
[email protected] | ba91a79 | 2013-02-06 09:48:28 | [diff] [blame] | 72 | class RenderWidgetCompositor; |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 73 | class RenderWidgetTest; |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 74 | class ResizingModeSelector; |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 75 | struct ContextMenuParams; |
[email protected] | 29e2fb4 | 2013-07-19 01:13:47 | [diff] [blame] | 76 | struct WebPluginGeometry; |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 77 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 78 | // RenderWidget provides a communication bridge between a WebWidget and |
| 79 | // a RenderWidgetHost, the latter of which lives in a different process. |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 80 | class CONTENT_EXPORT RenderWidget |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 81 | : public IPC::Listener, |
| 82 | public IPC::Sender, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 83 | NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 84 | public base::RefCounted<RenderWidget> { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 85 | public: |
| 86 | // Creates a new RenderWidget. The opener_id is the routing ID of the |
[email protected] | 38024409 | 2011-10-07 17:26:27 | [diff] [blame] | 87 | // RenderView that this widget lives inside. |
[email protected] | 0ebf387 | 2008-11-07 21:35:03 | [diff] [blame] | 88 | static RenderWidget* Create(int32 opener_id, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 89 | blink::WebPopupType popup_type, |
| 90 | const blink::WebScreenInfo& screen_info); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 91 | |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 92 | // Creates a WebWidget based on the popup type. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 93 | static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 94 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 95 | int32 routing_id() const { return routing_id_; } |
| 96 | int32 surface_id() const { return surface_id_; } |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 97 | blink::WebWidget* webwidget() const { return webwidget_; } |
[email protected] | 93b9d69 | 2011-04-13 00:44:31 | [diff] [blame] | 98 | gfx::Size size() const { return size_; } |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 99 | float filtered_time_per_frame() const { return filtered_time_per_frame_; } |
[email protected] | 589621b | 2010-09-23 22:01:07 | [diff] [blame] | 100 | bool has_focus() const { return has_focus_; } |
[email protected] | ee41e7d2 | 2011-10-14 19:34:09 | [diff] [blame] | 101 | bool is_fullscreen() const { return is_fullscreen_; } |
[email protected] | 204f1df | 2012-01-04 20:21:13 | [diff] [blame] | 102 | bool is_hidden() const { return is_hidden_; } |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 103 | bool handling_input_event() const { return handling_input_event_; } |
| 104 | // Temporary for debugging purposes... |
| 105 | bool closing() const { return closing_; } |
| 106 | bool is_swapped_out() { return is_swapped_out_; } |
| 107 | ui::MenuSourceType context_menu_source_type() { |
| 108 | return context_menu_source_type_; } |
| 109 | gfx::Point touch_editing_context_menu_location() { |
| 110 | return touch_editing_context_menu_location_; |
| 111 | } |
[email protected] | 589621b | 2010-09-23 22:01:07 | [diff] [blame] | 112 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 113 | // Functions to track out-of-process frames for special notifications. |
| 114 | void RegisterSwappedOutChildFrame(RenderFrameImpl* frame); |
| 115 | void UnregisterSwappedOutChildFrame(RenderFrameImpl* frame); |
| 116 | |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 117 | // IPC::Listener |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 118 | virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 119 | |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 120 | // IPC::Sender |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 121 | virtual bool Send(IPC::Message* msg) OVERRIDE; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 122 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 123 | // blink::WebWidgetClient |
[email protected] | 9ed83fe | 2013-02-27 01:52:28 | [diff] [blame] | 124 | virtual void suppressCompositorScheduling(bool enable); |
[email protected] | 9cd43a6 | 2012-03-26 08:03:56 | [diff] [blame] | 125 | virtual void willBeginCompositorFrame(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 126 | virtual void didInvalidateRect(const blink::WebRect&); |
[email protected] | 990278ff | 2012-11-13 02:12:55 | [diff] [blame] | 127 | virtual void didScrollRect(int dx, int dy, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 128 | const blink::WebRect& clipRect); |
| 129 | virtual void didAutoResize(const blink::WebSize& new_size); |
[email protected] | c0b0bd1 | 2014-03-13 00:39:58 | [diff] [blame] | 130 | // FIXME: To be removed as soon as chromium and blink side changes land |
| 131 | // didActivateCompositor with parameters is still kept in order to land |
| 132 | // these changes s-chromium - https://codereview.chromium.org/137893025/. |
| 133 | // s-blink - https://codereview.chromium.org/138523003/ |
[email protected] | 91acd1c | 2012-03-14 08:32:39 | [diff] [blame] | 134 | virtual void didActivateCompositor(int input_handler_identifier); |
[email protected] | c0b0bd1 | 2014-03-13 00:39:58 | [diff] [blame] | 135 | virtual void didActivateCompositor() OVERRIDE; |
[email protected] | ea162f9 | 2011-10-04 23:08:22 | [diff] [blame] | 136 | virtual void didDeactivateCompositor(); |
[email protected] | e195e58 | 2013-03-08 01:32:59 | [diff] [blame] | 137 | virtual void initializeLayerTreeView(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 138 | virtual blink::WebLayerTreeView* layerTreeView(); |
[email protected] | 3391a077 | 2012-03-28 00:32:07 | [diff] [blame] | 139 | virtual void didBecomeReadyForAdditionalInput(); |
[email protected] | 58264a3 | 2011-11-17 23:36:15 | [diff] [blame] | 140 | virtual void didCommitAndDrawCompositorFrame(); |
| 141 | virtual void didCompleteSwapBuffers(); |
[email protected] | 8b9e52b | 2014-01-17 16:35:31 | [diff] [blame] | 142 | virtual void scheduleComposite(); |
| 143 | virtual void scheduleAnimation(); |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 144 | virtual void didFocus(); |
| 145 | virtual void didBlur(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 146 | virtual void didChangeCursor(const blink::WebCursorInfo&); |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 147 | virtual void closeWidgetSoon(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 148 | virtual void show(blink::WebNavigationPolicy); |
[email protected] | dd48d49 | 2014-03-16 05:04:39 | [diff] [blame] | 149 | virtual void runModal() {} |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 150 | virtual blink::WebRect windowRect(); |
| 151 | virtual void setToolTipText(const blink::WebString& text, |
| 152 | blink::WebTextDirection hint); |
| 153 | virtual void setWindowRect(const blink::WebRect&); |
| 154 | virtual blink::WebRect windowResizerRect(); |
| 155 | virtual blink::WebRect rootWindowRect(); |
| 156 | virtual blink::WebScreenInfo screenInfo(); |
[email protected] | f660d9c | 2012-06-06 18:31:21 | [diff] [blame] | 157 | virtual float deviceScaleFactor(); |
[email protected] | fa7b1dc | 2010-06-23 17:53:04 | [diff] [blame] | 158 | virtual void resetInputMethod(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 159 | virtual void didHandleGestureEvent(const blink::WebGestureEvent& event, |
[email protected] | c68c3e4e | 2013-01-24 00:36:56 | [diff] [blame] | 160 | bool event_cancelled); |
[email protected] | 4873c7d | 2009-07-16 06:36:28 | [diff] [blame] | 161 | |
| 162 | // Called when a plugin is moved. These events are queued up and sent with |
| 163 | // the next paint or scroll message to the host. |
[email protected] | 29e2fb4 | 2013-07-19 01:13:47 | [diff] [blame] | 164 | void SchedulePluginMove(const WebPluginGeometry& move); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 165 | |
[email protected] | 26865477 | 2009-08-06 23:02:04 | [diff] [blame] | 166 | // Called when a plugin window has been destroyed, to make sure the currently |
| 167 | // pending moves don't try to reference it. |
| 168 | void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
| 169 | |
[email protected] | 24ed043 | 2013-04-24 07:50:31 | [diff] [blame] | 170 | RenderWidgetCompositor* compositor() const; |
| 171 | |
[email protected] | ebc0e1df | 2013-08-01 02:46:22 | [diff] [blame] | 172 | virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback); |
[email protected] | ba91a79 | 2013-02-06 09:48:28 | [diff] [blame] | 173 | |
[email protected] | 79fa22e | 2013-08-23 15:18:12 | [diff] [blame] | 174 | // Callback for use with synthetic gestures (e.g. BeginSmoothScroll). |
| 175 | typedef base::Callback<void()> SyntheticGestureCompletionCallback; |
[email protected] | 0e241b4b | 2012-08-18 09:06:27 | [diff] [blame] | 176 | |
[email protected] | 9017d785 | 2013-11-21 17:47:35 | [diff] [blame] | 177 | // Send a synthetic gesture to the browser to be queued to the synthetic |
| 178 | // gesture controller. |
| 179 | void QueueSyntheticGesture( |
| 180 | scoped_ptr<SyntheticGestureParams> gesture_params, |
| 181 | const SyntheticGestureCompletionCallback& callback); |
[email protected] | 1e1dd18 | 2013-09-12 01:51:15 | [diff] [blame] | 182 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 183 | // Close the underlying WebWidget. |
[email protected] | 60c42a8c7 | 2009-10-09 04:08:59 | [diff] [blame] | 184 | virtual void Close(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 185 | |
[email protected] | 6fceb91 | 2013-02-15 06:24:15 | [diff] [blame] | 186 | // Notifies about a compositor frame commit operation having finished. |
| 187 | virtual void DidCommitCompositorFrame(); |
| 188 | |
[email protected] | 66fca5bc | 2013-05-23 06:58:29 | [diff] [blame] | 189 | // Handle common setup/teardown for handling IME events. |
| 190 | void StartHandlingImeEvent(); |
| 191 | void FinishHandlingImeEvent(); |
| 192 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 193 | // Returns whether we currently should handle an IME event. |
| 194 | bool ShouldHandleImeEvent(); |
| 195 | |
[email protected] | 3300477 | 2013-11-12 09:49:23 | [diff] [blame] | 196 | virtual void InstrumentWillBeginFrame(int frame_id) {} |
[email protected] | 35134e1 | 2013-02-22 20:07:40 | [diff] [blame] | 197 | virtual void InstrumentDidBeginFrame() {} |
| 198 | virtual void InstrumentDidCancelFrame() {} |
| 199 | virtual void InstrumentWillComposite() {} |
| 200 | |
[email protected] | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame] | 201 | bool UsingSynchronousRendererCompositor() const; |
[email protected] | 34bb3ac | 2013-03-08 02:41:28 | [diff] [blame] | 202 | |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 203 | // ScreenMetricsEmulator class manages screen emulation inside a render |
| 204 | // widget. This includes resizing, placing view on the screen at desired |
| 205 | // position, changing device scale factor, and scaling down the whole |
| 206 | // widget if required to fit into the browser window. |
| 207 | class ScreenMetricsEmulator; |
| 208 | |
| 209 | // Emulates screen and widget metrics. Supplied values override everything |
| 210 | // coming from host. |
| 211 | void EnableScreenMetricsEmulation( |
[email protected] | 1919368 | 2014-04-03 15:01:43 | [diff] [blame] | 212 | const blink::WebDeviceEmulationParams& params); |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 213 | void DisableScreenMetricsEmulation(); |
| 214 | void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator); |
| 215 | |
[email protected] | 7d08a935 | 2013-10-15 08:24:56 | [diff] [blame] | 216 | void ScheduleCompositeWithForcedRedraw(); |
| 217 | |
[email protected] | 4d7e46a | 2013-11-08 05:33:40 | [diff] [blame] | 218 | // Called by the compositor in single-threaded mode when a swap is posted, |
| 219 | // completes or is aborted. |
| 220 | void OnSwapBuffersPosted(); |
| 221 | void OnSwapBuffersComplete(); |
| 222 | void OnSwapBuffersAborted(); |
| 223 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 224 | // Checks if the text input state and compose inline mode have been changed. |
| 225 | // If they are changed, the new value will be sent to the browser process. |
| 226 | void UpdateTextInputType(); |
| 227 | |
| 228 | // Checks if the selection bounds have been changed. If they are changed, |
| 229 | // the new value will be sent to the browser process. |
| 230 | void UpdateSelectionBounds(); |
| 231 | |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 232 | virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end); |
| 233 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 234 | void OnShowHostContextMenu(ContextMenuParams* params); |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 235 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 236 | #if defined(OS_ANDROID) || defined(USE_AURA) |
[email protected] | 90f2415 | 2014-04-09 12:41:36 | [diff] [blame] | 237 | enum ShowIme { |
| 238 | SHOW_IME_IF_NEEDED, |
| 239 | NO_SHOW_IME, |
| 240 | }; |
| 241 | |
| 242 | enum ChangeSource { |
| 243 | FROM_NON_IME, |
| 244 | FROM_IME, |
| 245 | }; |
| 246 | |
| 247 | // |show_ime| should be SHOW_IME_IF_NEEDED iff the update may cause the ime to |
| 248 | // be displayed, e.g. after a tap on an input field on mobile. |
| 249 | // |change_source| should be FROM_NON_IME when the renderer has to wait for |
| 250 | // the browser to acknowledge the change before the renderer handles any more |
| 251 | // IME events. This is when the text change did not originate from the IME in |
| 252 | // the browser side, such as changes by JavaScript or autofill. |
| 253 | void UpdateTextInputState(ShowIme show_ime, ChangeSource change_source); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 254 | #endif |
| 255 | |
[email protected] | f9db7d2d | 2014-04-11 16:07:11 | [diff] [blame] | 256 | #if defined(OS_MACOSX) || defined(USE_AURA) |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 257 | // Checks if the composition range or composition character bounds have been |
| 258 | // changed. If they are changed, the new value will be sent to the browser |
| 259 | // process. |
| 260 | void UpdateCompositionInfo(bool should_update_range); |
| 261 | #endif |
| 262 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 263 | protected: |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 264 | // Friend RefCounted so that the dtor can be non-public. Using this class |
| 265 | // without ref-counting is an error. |
| 266 | friend class base::RefCounted<RenderWidget>; |
[email protected] | 7339cd2 | 2010-10-27 00:11:20 | [diff] [blame] | 267 | // For unit tests. |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 268 | friend class RenderWidgetTest; |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 269 | |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 270 | enum ResizeAck { |
| 271 | SEND_RESIZE_ACK, |
| 272 | NO_RESIZE_ACK, |
| 273 | }; |
| 274 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 275 | RenderWidget(blink::WebPopupType popup_type, |
| 276 | const blink::WebScreenInfo& screen_info, |
[email protected] | 1ac10dca | 2013-08-20 20:47:04 | [diff] [blame] | 277 | bool swapped_out, |
| 278 | bool hidden); |
[email protected] | ce2b28e | 2012-08-09 15:53:57 | [diff] [blame] | 279 | |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 280 | virtual ~RenderWidget(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 281 | |
| 282 | // Initializes this view with the given opener. CompleteInit must be called |
| 283 | // later. |
[email protected] | a635f94 | 2012-12-07 10:34:29 | [diff] [blame] | 284 | bool Init(int32 opener_id); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 285 | |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 286 | // Called by Init and subclasses to perform initialization. |
[email protected] | a635f94 | 2012-12-07 10:34:29 | [diff] [blame] | 287 | bool DoInit(int32 opener_id, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 288 | blink::WebWidget* web_widget, |
[email protected] | 48495594 | 2010-08-19 16:13:18 | [diff] [blame] | 289 | IPC::SyncMessage* create_widget_message); |
| 290 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 291 | // Finishes creation of a pending view started with Init. |
[email protected] | fc4404d | 2012-11-07 19:53:30 | [diff] [blame] | 292 | void CompleteInit(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 293 | |
[email protected] | 992db4c | 2011-05-12 15:37:15 | [diff] [blame] | 294 | // Sets whether this RenderWidget has been swapped out to be displayed by |
| 295 | // a RenderWidget in a different process. If so, no new IPC messages will be |
| 296 | // sent (only ACKs) and the process is free to exit when there are no other |
| 297 | // active RenderWidgets. |
| 298 | void SetSwappedOut(bool is_swapped_out); |
| 299 | |
[email protected] | 661eb9d | 2009-02-03 02:11:48 | [diff] [blame] | 300 | // Paints the given rectangular region of the WebWidget into canvas (a |
| 301 | // shared memory segment returned by AllocPaintBuf on Windows). The caller |
| 302 | // must ensure that the given rect fits within the bounds of the WebWidget. |
[email protected] | 4fb6684 | 2009-12-04 21:41:00 | [diff] [blame] | 303 | void PaintRect(const gfx::Rect& rect, const gfx::Point& canvas_origin, |
[email protected] | 9d611ca | 2012-11-14 13:46:56 | [diff] [blame] | 304 | SkCanvas* canvas); |
[email protected] | 4fb6684 | 2009-12-04 21:41:00 | [diff] [blame] | 305 | |
| 306 | // Paints a border at the given rect for debugging purposes. |
[email protected] | 9d611ca | 2012-11-14 13:46:56 | [diff] [blame] | 307 | void PaintDebugBorder(const gfx::Rect& rect, SkCanvas* canvas); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 308 | |
[email protected] | bd37ae25 | 2011-06-03 01:28:18 | [diff] [blame] | 309 | bool IsRenderingVSynced(); |
[email protected] | 52ccd0ea | 2011-02-16 01:09:05 | [diff] [blame] | 310 | void AnimationCallback(); |
| 311 | void AnimateIfNeeded(); |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 312 | void InvalidationCallback(); |
[email protected] | fd84779 | 2013-10-24 17:12:35 | [diff] [blame] | 313 | void FlushPendingInputEventAck(); |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 314 | void DoDeferredUpdateAndSendInputAck(); |
[email protected] | 552e600 | 2009-11-19 05:24:57 | [diff] [blame] | 315 | void DoDeferredUpdate(); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 316 | void DoDeferredClose(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 317 | void DoDeferredSetWindowRect(const blink::WebRect& pos); |
[email protected] | f0c2a24 | 2013-03-15 19:34:52 | [diff] [blame] | 318 | virtual void Composite(base::TimeTicks frame_begin_time); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 319 | |
[email protected] | 699ab0d | 2009-04-23 23:19:14 | [diff] [blame] | 320 | // Set the background of the render widget to a bitmap. The bitmap will be |
| 321 | // tiled in both directions if it isn't big enough to fill the area. This is |
| 322 | // mainly intended to be used in conjuction with WebView::SetIsTransparent(). |
| 323 | virtual void SetBackground(const SkBitmap& bitmap); |
| 324 | |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 325 | // Resizes the render widget. |
| 326 | void Resize(const gfx::Size& new_size, |
[email protected] | 60d47ac | 2013-03-01 23:42:44 | [diff] [blame] | 327 | const gfx::Size& physical_backing_size, |
[email protected] | d908376 | 2013-03-24 01:36:40 | [diff] [blame] | 328 | float overdraw_bottom_height, |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 329 | const gfx::Rect& resizer_rect, |
| 330 | bool is_fullscreen, |
| 331 | ResizeAck resize_ack); |
[email protected] | 9265016 | 2013-10-30 03:31:02 | [diff] [blame] | 332 | // Used to force the size of a window when running layout tests. |
| 333 | void ResizeSynchronously(const gfx::Rect& new_position); |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 334 | virtual void SetScreenMetricsEmulationParameters( |
[email protected] | 7f99fc2 | 2013-11-08 14:05:58 | [diff] [blame] | 335 | float device_scale_factor, |
| 336 | const gfx::Point& root_layer_offset, |
| 337 | float root_layer_scale); |
[email protected] | 5390786 | 2014-03-25 15:42:40 | [diff] [blame] | 338 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 339 | void SetExternalPopupOriginAdjustmentsForEmulation( |
| 340 | ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator); |
[email protected] | 5390786 | 2014-03-25 15:42:40 | [diff] [blame] | 341 | #endif |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 342 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 343 | // RenderWidget IPC message handlers |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 344 | void OnHandleInputEvent(const blink::WebInputEvent* event, |
[email protected] | 205294b | 2014-03-18 20:48:35 | [diff] [blame] | 345 | const ui::LatencyInfo& latency_info, |
[email protected] | c084330e0 | 2013-04-27 01:08:15 | [diff] [blame] | 346 | bool keyboard_shortcut); |
[email protected] | 34202de | 2013-05-06 23:36:22 | [diff] [blame] | 347 | void OnCursorVisibilityChange(bool is_visible); |
[email protected] | c084330e0 | 2013-04-27 01:08:15 | [diff] [blame] | 348 | void OnMouseCaptureLost(); |
| 349 | virtual void OnSetFocus(bool enable); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 350 | void OnClose(); |
[email protected] | fc4404d | 2012-11-07 19:53:30 | [diff] [blame] | 351 | void OnCreatingNewAck(); |
[email protected] | 0fdd501 | 2013-05-29 08:05:56 | [diff] [blame] | 352 | virtual void OnResize(const ViewMsg_Resize_Params& params); |
[email protected] | b5913d7 | 2012-02-07 22:26:54 | [diff] [blame] | 353 | void OnChangeResizeRect(const gfx::Rect& resizer_rect); |
[email protected] | 941e455 | 2010-02-01 21:23:43 | [diff] [blame] | 354 | virtual void OnWasHidden(); |
[email protected] | 9e2e463 | 2012-07-27 16:38:41 | [diff] [blame] | 355 | virtual void OnWasShown(bool needs_repainting); |
[email protected] | 992db4c | 2011-05-12 15:37:15 | [diff] [blame] | 356 | virtual void OnWasSwappedOut(); |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 357 | void OnUpdateRectAck(); |
[email protected] | 8400e03 | 2010-02-26 18:50:11 | [diff] [blame] | 358 | void OnCreateVideoAck(int32 video_id); |
| 359 | void OnUpdateVideoAck(int32 video_id); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 360 | void OnRequestMoveAck(); |
[email protected] | fa7b1dc | 2010-06-23 17:53:04 | [diff] [blame] | 361 | void OnSetInputMethodActive(bool is_active); |
[email protected] | 37a241c | 2013-12-03 03:16:17 | [diff] [blame] | 362 | void OnCandidateWindowShown(); |
| 363 | void OnCandidateWindowUpdated(); |
| 364 | void OnCandidateWindowHidden(); |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 365 | virtual void OnImeSetComposition( |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 366 | const base::string16& text, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 367 | const std::vector<blink::WebCompositionUnderline>& underlines, |
[email protected] | fa7b1dc | 2010-06-23 17:53:04 | [diff] [blame] | 368 | int selection_start, |
| 369 | int selection_end); |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 370 | virtual void OnImeConfirmComposition(const base::string16& text, |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 371 | const gfx::Range& replacement_range, |
[email protected] | 0e45bd0 | 2013-07-12 20:20:02 | [diff] [blame] | 372 | bool keep_selection); |
[email protected] | 0bc1f57 | 2013-04-17 01:46:31 | [diff] [blame] | 373 | void OnRepaint(gfx::Size size_to_paint); |
[email protected] | 79fa22e | 2013-08-23 15:18:12 | [diff] [blame] | 374 | void OnSyntheticGestureCompleted(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 375 | void OnSetTextDirection(blink::WebTextDirection direction); |
[email protected] | 872ae5b | 2011-05-26 20:20:50 | [diff] [blame] | 376 | void OnGetFPS(); |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 377 | void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
| 378 | const gfx::Rect& window_screen_rect); |
[email protected] | 105dffb4 | 2013-02-20 03:46:21 | [diff] [blame] | 379 | #if defined(OS_ANDROID) |
[email protected] | 2384b6c | 2013-02-28 23:58:51 | [diff] [blame] | 380 | void OnShowImeIfNeeded(); |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 381 | |
| 382 | // Whenever an IME event that needs an acknowledgement is sent to the browser, |
| 383 | // the number of outstanding IME events that needs acknowledgement should be |
| 384 | // incremented. All IME events will be dropped until we receive an ack from |
| 385 | // the browser. |
| 386 | void IncrementOutstandingImeEventAcks(); |
| 387 | |
| 388 | // Called by the browser process for every required IME acknowledgement. |
| 389 | void OnImeEventAck(); |
[email protected] | 105dffb4 | 2013-02-20 03:46:21 | [diff] [blame] | 390 | #endif |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 391 | |
[email protected] | 51a4950 | 2013-03-23 01:50:19 | [diff] [blame] | 392 | void OnSnapshot(const gfx::Rect& src_subrect); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 393 | |
[email protected] | 847a258 | 2013-03-09 02:29:51 | [diff] [blame] | 394 | // Notify the compositor about a change in viewport size. This should be |
| 395 | // used only with auto resize mode WebWidgets, as normal WebWidgets should |
| 396 | // go through OnResize. |
[email protected] | 97e1bf7 | 2013-03-06 14:06:05 | [diff] [blame] | 397 | void AutoResizeCompositor(); |
| 398 | |
[email protected] | 468ac58 | 2012-11-20 00:53:19 | [diff] [blame] | 399 | virtual void SetDeviceScaleFactor(float device_scale_factor); |
| 400 | |
[email protected] | 29ed96a | 2012-02-04 18:12:16 | [diff] [blame] | 401 | // Override points to notify derived classes that a paint has happened. |
[email protected] | 0704ac3 | 2013-10-03 15:24:22 | [diff] [blame] | 402 | // DidInitiatePaint happens when that has completed, and subsequent rendering |
| 403 | // won't affect the painted content. DidFlushPaint happens once we've received |
| 404 | // the ACK that the screen has been updated. For a given paint operation, |
| 405 | // these overrides will always be called in the order DidInitiatePaint, |
| 406 | // DidFlushPaint. |
[email protected] | 00c3961 | 2010-03-06 02:53:28 | [diff] [blame] | 407 | virtual void DidInitiatePaint() {} |
| 408 | virtual void DidFlushPaint() {} |
[email protected] | a2f6bc11 | 2009-06-27 16:27:25 | [diff] [blame] | 409 | |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 410 | // Override and return true when the widget is rendered with a graphics |
[email protected] | 37a6f30 | 2011-07-11 23:43:08 | [diff] [blame] | 411 | // context that supports asynchronous swapbuffers. When returning true, the |
| 412 | // subclass must call OnSwapBuffersPosted() when swap is posted, |
| 413 | // OnSwapBuffersComplete() when swaps complete, and OnSwapBuffersAborted if |
| 414 | // the context is lost. |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 415 | virtual bool SupportsAsynchronousSwapBuffers(); |
[email protected] | ed7defa | 2013-03-12 21:29:59 | [diff] [blame] | 416 | virtual GURL GetURLForGraphicsContext3D(); |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 417 | |
[email protected] | 479b017 | 2012-10-29 19:27:09 | [diff] [blame] | 418 | virtual bool ForceCompositingModeEnabled(); |
| 419 | |
[email protected] | d54169e9 | 2011-01-21 09:19:52 | [diff] [blame] | 420 | // Gets the scroll offset of this widget, if this widget has a notion of |
| 421 | // scroll offset. |
[email protected] | ceb36f7d | 2012-10-31 18:33:24 | [diff] [blame] | 422 | virtual gfx::Vector2d GetScrollOffset(); |
[email protected] | d54169e9 | 2011-01-21 09:19:52 | [diff] [blame] | 423 | |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 424 | // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
| 425 | // use this method so that we can properly inform the RenderThread of our |
| 426 | // state. |
| 427 | void SetHidden(bool hidden); |
| 428 | |
[email protected] | 2b624c56 | 2011-10-27 22:58:26 | [diff] [blame] | 429 | void WillToggleFullscreen(); |
| 430 | void DidToggleFullscreen(); |
| 431 | |
[email protected] | 67474193 | 2009-02-04 23:44:46 | [diff] [blame] | 432 | bool next_paint_is_resize_ack() const; |
| 433 | bool next_paint_is_restore_ack() const; |
| 434 | void set_next_paint_is_resize_ack(); |
| 435 | void set_next_paint_is_restore_ack(); |
| 436 | void set_next_paint_is_repaint_ack(); |
[email protected] | ec7dc11 | 2008-08-06 05:30:12 | [diff] [blame] | 437 | |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 438 | // Override point to obtain that the current input method state and caret |
| 439 | // position. |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 440 | virtual ui::TextInputType GetTextInputType(); |
[email protected] | 5b739cb | 2012-08-21 20:35:21 | [diff] [blame] | 441 | virtual ui::TextInputType WebKitToUiTextInputType( |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 442 | blink::WebTextInputType type); |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 443 | |
[email protected] | f9db7d2d | 2014-04-11 16:07:11 | [diff] [blame] | 444 | #if defined(OS_MACOSX) || defined(USE_AURA) |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 445 | // Override point to obtain that the current composition character bounds. |
| 446 | // In the case of surrogate pairs, the character is treated as two characters: |
| 447 | // the bounds for first character is actual one, and the bounds for second |
| 448 | // character is zero width rectangle. |
| 449 | virtual void GetCompositionCharacterBounds( |
| 450 | std::vector<gfx::Rect>* character_bounds); |
| 451 | |
[email protected] | 88dbe32f | 2013-06-20 23:31:36 | [diff] [blame] | 452 | // Returns the range of the text that is being composed or the selection if |
| 453 | // the composition does not exist. |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 454 | virtual void GetCompositionRange(gfx::Range* range); |
[email protected] | 88dbe32f | 2013-06-20 23:31:36 | [diff] [blame] | 455 | |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 456 | // Returns true if the composition range or composition character bounds |
| 457 | // should be sent to the browser process. |
| 458 | bool ShouldUpdateCompositionInfo( |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 459 | const gfx::Range& range, |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 460 | const std::vector<gfx::Rect>& bounds); |
[email protected] | 501ea13d | 2013-07-09 17:03:29 | [diff] [blame] | 461 | #endif |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 462 | |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 463 | // Override point to obtain that the current input method state about |
| 464 | // composition text. |
| 465 | virtual bool CanComposeInline(); |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 466 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 467 | // Tells the renderer it does not have focus. Used to prevent us from getting |
| 468 | // the focus on our own when the browser did not focus us. |
| 469 | void ClearFocus(); |
| 470 | |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 471 | // Set the pending window rect. |
| 472 | // Because the real render_widget is hosted in another process, there is |
| 473 | // a time period where we may have set a new window rect which has not yet |
| 474 | // been processed by the browser. So we maintain a pending window rect |
| 475 | // size. If JS code sets the WindowRect, and then immediately calls |
| 476 | // GetWindowRect() we'll use this pending window rect as the size. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 477 | void SetPendingWindowRect(const blink::WebRect& r); |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 478 | |
[email protected] | 44670587 | 2009-09-10 07:22:48 | [diff] [blame] | 479 | // Called by OnHandleInputEvent() to notify subclasses that a key event was |
| 480 | // just handled. |
| 481 | virtual void DidHandleKeyEvent() {} |
| 482 | |
[email protected] | 72aee84 | 2014-02-20 19:41:41 | [diff] [blame] | 483 | // Called by OnHandleInputEvent() to notify subclasses that a user gesture |
| 484 | // event will be processed. |
| 485 | virtual void WillProcessUserGesture() {} |
| 486 | |
[email protected] | 67bfb83f | 2011-09-22 03:36:37 | [diff] [blame] | 487 | // Called by OnHandleInputEvent() to notify subclasses that a mouse event is |
| 488 | // about to be handled. |
| 489 | // Returns true if no further handling is needed. In that case, the event |
| 490 | // won't be sent to WebKit or trigger DidHandleMouseEvent(). |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 491 | virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event); |
[email protected] | 67bfb83f | 2011-09-22 03:36:37 | [diff] [blame] | 492 | |
[email protected] | 41d8685 | 2012-11-07 12:23:24 | [diff] [blame] | 493 | // Called by OnHandleInputEvent() to notify subclasses that a gesture event is |
| 494 | // about to be handled. |
| 495 | // Returns true if no further handling is needed. In that case, the event |
| 496 | // won't be sent to WebKit. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 497 | virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event); |
[email protected] | 41d8685 | 2012-11-07 12:23:24 | [diff] [blame] | 498 | |
[email protected] | 6a8ddba5 | 2010-09-05 04:38:06 | [diff] [blame] | 499 | // Called by OnHandleInputEvent() to notify subclasses that a mouse event was |
| 500 | // just handled. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 501 | virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {} |
[email protected] | 6a8ddba5 | 2010-09-05 04:38:06 | [diff] [blame] | 502 | |
[email protected] | 2d0f2e9 | 2011-10-03 09:02:24 | [diff] [blame] | 503 | // Called by OnHandleInputEvent() to notify subclasses that a touch event was |
| 504 | // just handled. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 505 | virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {} |
[email protected] | 2d0f2e9 | 2011-10-03 09:02:24 | [diff] [blame] | 506 | |
[email protected] | 3d5c243b | 2012-11-30 00:26:01 | [diff] [blame] | 507 | // Check whether the WebWidget has any touch event handlers registered |
| 508 | // at the given point. |
| 509 | virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; |
| 510 | |
[email protected] | ce6689f | 2013-03-29 12:52:55 | [diff] [blame] | 511 | // Check whether the WebWidget has any touch event handlers registered. |
| 512 | virtual void hasTouchEventHandlers(bool has_handlers); |
| 513 | |
[email protected] | 5d0bbdfa9 | 2013-12-10 00:35:51 | [diff] [blame] | 514 | // Tell the browser about the actions permitted for a new touch point. |
| 515 | virtual void setTouchAction(blink::WebTouchAction touch_action); |
| 516 | |
[email protected] | 90f2415 | 2014-04-09 12:41:36 | [diff] [blame] | 517 | // Called when value of focused text field gets dirty, e.g. value is modified |
| 518 | // by script, not by user input. |
| 519 | virtual void didUpdateTextOfFocusedElementByNonUserInput(); |
| 520 | |
[email protected] | a80aea7 | 2014-03-14 21:10:15 | [diff] [blame] | 521 | #if defined(OS_ANDROID) |
| 522 | // Checks if the selection root bounds have changed. If they have changed, the |
| 523 | // new value will be sent to the browser process. |
| 524 | virtual void UpdateSelectionRootBounds(); |
| 525 | #endif |
| 526 | |
[email protected] | ed7defa | 2013-03-12 21:29:59 | [diff] [blame] | 527 | // Creates a 3D context associated with this view. |
[email protected] | 828a393 | 2014-04-02 14:43:13 | [diff] [blame] | 528 | scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D(); |
[email protected] | ed7defa | 2013-03-12 21:29:59 | [diff] [blame] | 529 | |
[email protected] | 51a4950 | 2013-03-23 01:50:19 | [diff] [blame] | 530 | bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); |
| 531 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 532 | // Routing ID that allows us to communicate to the parent browser process |
| 533 | // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
| 534 | int32 routing_id_; |
| 535 | |
[email protected] | 9f4f332 | 2012-01-18 22:29:56 | [diff] [blame] | 536 | int32 surface_id_; |
| 537 | |
[email protected] | c5b3b5e | 2009-02-13 06:41:11 | [diff] [blame] | 538 | // We are responsible for destroying this object via its Close method. |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 539 | // May be NULL when the window is closing. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 540 | blink::WebWidget* webwidget_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 541 | |
[email protected] | 8926c60 | 2013-01-23 05:32:06 | [diff] [blame] | 542 | // This is lazily constructed and must not outlive webwidget_. |
[email protected] | ba91a79 | 2013-02-06 09:48:28 | [diff] [blame] | 543 | scoped_ptr<RenderWidgetCompositor> compositor_; |
[email protected] | 8926c60 | 2013-01-23 05:32:06 | [diff] [blame] | 544 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 545 | // Set to the ID of the view that initiated creating this view, if any. When |
| 546 | // the view was initiated by the browser (the common case), this will be |
| 547 | // MSG_ROUTING_NONE. This is used in determining ownership when opening |
| 548 | // child tabs. See RenderWidget::createWebViewWithRequest. |
| 549 | // |
| 550 | // This ID may refer to an invalid view if that view is closed before this |
| 551 | // view is. |
| 552 | int32 opener_id_; |
| 553 | |
| 554 | // The position where this view should be initially shown. |
| 555 | gfx::Rect initial_pos_; |
| 556 | |
[email protected] | fc4404d | 2012-11-07 19:53:30 | [diff] [blame] | 557 | bool init_complete_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 558 | |
| 559 | // We store the current cursor object so we can avoid spamming SetCursor |
| 560 | // messages. |
| 561 | WebCursor current_cursor_; |
[email protected] | 88efb7ec | 2009-07-14 16:32:59 | [diff] [blame] | 562 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 563 | // The size of the RenderWidget. |
| 564 | gfx::Size size_; |
| 565 | |
[email protected] | b4d0845 | 2010-10-05 17:34:35 | [diff] [blame] | 566 | // The TransportDIB that is being used to transfer an image to the browser. |
| 567 | TransportDIB* current_paint_buf_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 568 | |
[email protected] | 552e600 | 2009-11-19 05:24:57 | [diff] [blame] | 569 | PaintAggregator paint_aggregator_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 570 | |
[email protected] | 60d47ac | 2013-03-01 23:42:44 | [diff] [blame] | 571 | // The size of the view's backing surface in non-DPI-adjusted pixels. |
| 572 | gfx::Size physical_backing_size_; |
| 573 | |
[email protected] | d908376 | 2013-03-24 01:36:40 | [diff] [blame] | 574 | // The height of the physical backing surface that is overdrawn opaquely in |
| 575 | // the browser, for example by an on-screen-keyboard (in DPI-adjusted pixels). |
| 576 | float overdraw_bottom_height_; |
| 577 | |
[email protected] | f21c613a | 2009-02-12 14:46:17 | [diff] [blame] | 578 | // The area that must be reserved for drawing the resize corner. |
| 579 | gfx::Rect resizer_rect_; |
| 580 | |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 581 | // Flags for the next ViewHostMsg_UpdateRect message. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 582 | int next_paint_flags_; |
| 583 | |
[email protected] | 872ae5b | 2011-05-26 20:20:50 | [diff] [blame] | 584 | // Filtered time per frame based on UpdateRect messages. |
| 585 | float filtered_time_per_frame_; |
| 586 | |
[email protected] | 53d3f30 | 2009-12-21 04:42:05 | [diff] [blame] | 587 | // True if we are expecting an UpdateRect_ACK message (i.e., that a |
| 588 | // UpdateRect message has been sent). |
| 589 | bool update_reply_pending_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 590 | |
[email protected] | 847a258 | 2013-03-09 02:29:51 | [diff] [blame] | 591 | // Whether the WebWidget is in auto resize mode, which is used for example |
| 592 | // by extension popups. |
| 593 | bool auto_resize_mode_; |
| 594 | |
[email protected] | ea3ee0a | 2012-05-15 03:43:09 | [diff] [blame] | 595 | // True if we need to send an UpdateRect message to notify the browser about |
| 596 | // an already-completed auto-resize. |
| 597 | bool need_update_rect_for_auto_resize_; |
| 598 | |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 599 | // True if the underlying graphics context supports asynchronous swap. |
| 600 | // Cached on the RenderWidget because determining support is costly. |
| 601 | bool using_asynchronous_swapbuffers_; |
| 602 | |
| 603 | // Number of OnSwapBuffersComplete we are expecting. Incremented each time |
| 604 | // WebWidget::composite has been been performed when the RenderWidget subclass |
| 605 | // SupportsAsynchronousSwapBuffers. Decremented in OnSwapBuffers. Will block |
| 606 | // rendering. |
| 607 | int num_swapbuffers_complete_pending_; |
| 608 | |
| 609 | // When accelerated rendering is on, is the maximum number of swapbuffers that |
| 610 | // can be outstanding before we start throttling based on |
| 611 | // OnSwapBuffersComplete callback. |
[email protected] | 82ca9b9 | 2011-09-12 23:33:07 | [diff] [blame] | 612 | static const int kMaxSwapBuffersPending = 2; |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 613 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 614 | // Set to true if we should ignore RenderWidget::Show calls. |
| 615 | bool did_show_; |
| 616 | |
| 617 | // Indicates that we shouldn't bother generated paint events. |
| 618 | bool is_hidden_; |
| 619 | |
[email protected] | ee41e7d2 | 2011-10-14 19:34:09 | [diff] [blame] | 620 | // Indicates that we are in fullscreen mode. |
| 621 | bool is_fullscreen_; |
| 622 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 623 | // Indicates that we should be repainted when restored. This flag is set to |
| 624 | // true if we receive an invalidation / scroll event from webkit while our |
| 625 | // is_hidden_ flag is set to true. This is used to force a repaint once we |
| 626 | // restore to account for the fact that our host would not know about the |
| 627 | // invalidation / scroll event(s) from webkit while we are hidden. |
| 628 | bool needs_repainting_on_restore_; |
| 629 | |
| 630 | // Indicates whether we have been focused/unfocused by the browser. |
| 631 | bool has_focus_; |
| 632 | |
[email protected] | 5dd76821 | 2009-08-13 23:34:49 | [diff] [blame] | 633 | // Are we currently handling an input event? |
| 634 | bool handling_input_event_; |
| 635 | |
[email protected] | e8f775f | 2013-02-14 21:00:50 | [diff] [blame] | 636 | // Are we currently handling an ime event? |
| 637 | bool handling_ime_event_; |
| 638 | |
[email protected] | 5d0bbdfa9 | 2013-12-10 00:35:51 | [diff] [blame] | 639 | // Are we currently handling a touchstart event? |
| 640 | bool handling_touchstart_event_; |
| 641 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 642 | // True if we have requested this widget be closed. No more messages will |
| 643 | // be sent, except for a Close. |
| 644 | bool closing_; |
| 645 | |
[email protected] | 992db4c | 2011-05-12 15:37:15 | [diff] [blame] | 646 | // Whether this RenderWidget is currently swapped out, such that the view is |
| 647 | // being rendered by another process. If all RenderWidgets in a process are |
| 648 | // swapped out, the process can exit. |
| 649 | bool is_swapped_out_; |
| 650 | |
[email protected] | fa7b1dc | 2010-06-23 17:53:04 | [diff] [blame] | 651 | // Indicates if an input method is active in the browser process. |
| 652 | bool input_method_is_active_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 653 | |
[email protected] | 5b739cb | 2012-08-21 20:35:21 | [diff] [blame] | 654 | // Stores information about the current text input. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 655 | blink::WebTextInputInfo text_input_info_; |
[email protected] | 5b739cb | 2012-08-21 20:35:21 | [diff] [blame] | 656 | |
[email protected] | fa7b1dc | 2010-06-23 17:53:04 | [diff] [blame] | 657 | // Stores the current text input type of |webwidget_|. |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 658 | ui::TextInputType text_input_type_; |
| 659 | |
[email protected] | b256eca | 2013-07-11 10:57:40 | [diff] [blame] | 660 | // Stores the current text input mode of |webwidget_|. |
| 661 | ui::TextInputMode text_input_mode_; |
| 662 | |
[email protected] | 86ba5fcb | 2013-09-04 00:36:53 | [diff] [blame] | 663 | // Stores the current type of composition text rendering of |webwidget_|. |
| 664 | bool can_compose_inline_; |
| 665 | |
[email protected] | e99ef6f | 2011-10-16 01:13:00 | [diff] [blame] | 666 | // Stores the current selection bounds. |
[email protected] | 7c8873e | 2013-02-05 08:03:01 | [diff] [blame] | 667 | gfx::Rect selection_focus_rect_; |
| 668 | gfx::Rect selection_anchor_rect_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 669 | |
[email protected] | a80aea7 | 2014-03-14 21:10:15 | [diff] [blame] | 670 | // Stores the current selection root bounds. |
| 671 | #if defined(OS_ANDROID) |
| 672 | gfx::Rect selection_root_rect_; |
| 673 | #endif |
| 674 | |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 675 | // Stores the current composition character bounds. |
| 676 | std::vector<gfx::Rect> composition_character_bounds_; |
| 677 | |
| 678 | // Stores the current composition range. |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 679 | gfx::Range composition_range_; |
[email protected] | 58b48a0d | 2012-06-13 07:01:35 | [diff] [blame] | 680 | |
[email protected] | 3e2b375b | 2010-04-07 17:03:12 | [diff] [blame] | 681 | // The kind of popup this widget represents, NONE if not a popup. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 682 | blink::WebPopupType popup_type_; |
[email protected] | 0ebf387 | 2008-11-07 21:35:03 | [diff] [blame] | 683 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 684 | // Holds all the needed plugin window moves for a scroll. |
[email protected] | 29e2fb4 | 2013-07-19 01:13:47 | [diff] [blame] | 685 | typedef std::vector<WebPluginGeometry> WebPluginGeometryVector; |
[email protected] | 26865477 | 2009-08-06 23:02:04 | [diff] [blame] | 686 | WebPluginGeometryVector plugin_window_moves_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 687 | |
[email protected] | 699ab0d | 2009-04-23 23:19:14 | [diff] [blame] | 688 | // A custom background for the widget. |
| 689 | SkBitmap background_; |
| 690 | |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 691 | // While we are waiting for the browser to update window sizes, we track the |
| 692 | // pending size temporarily. |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 693 | int pending_window_rect_count_; |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 694 | blink::WebRect pending_window_rect_; |
[email protected] | 2533ce1 | 2009-05-09 00:02:24 | [diff] [blame] | 695 | |
[email protected] | 80ad862 | 2012-11-07 16:33:03 | [diff] [blame] | 696 | // The screen rects of the view and the window that contains it. |
| 697 | gfx::Rect view_screen_rect_; |
| 698 | gfx::Rect window_screen_rect_; |
| 699 | |
[email protected] | 12fbad81 | 2009-09-01 18:21:24 | [diff] [blame] | 700 | scoped_ptr<IPC::Message> pending_input_event_ack_; |
| 701 | |
[email protected] | fd84779 | 2013-10-24 17:12:35 | [diff] [blame] | 702 | // The time spent in input handlers this frame. Used to throttle input acks. |
| 703 | base::TimeDelta total_input_handling_time_this_frame_; |
| 704 | |
[email protected] | b68a0e5 | 2011-12-08 15:11:12 | [diff] [blame] | 705 | // Indicates if the next sequence of Char events should be suppressed or not. |
| 706 | bool suppress_next_char_events_; |
| 707 | |
[email protected] | a79d8a63 | 2010-11-18 22:35:56 | [diff] [blame] | 708 | // Set to true if painting to the window is handled by the accelerated |
| 709 | // compositor. |
| 710 | bool is_accelerated_compositing_active_; |
[email protected] | edbcde93 | 2010-05-07 17:10:46 | [diff] [blame] | 711 | |
[email protected] | d8a6c5d1 | 2013-09-23 04:37:10 | [diff] [blame] | 712 | // Set to true if compositing has ever been active for this widget. Once a |
| 713 | // widget has used compositing, it will act as though force compositing mode |
| 714 | // is on for the remainder of the widget's lifetime. |
| 715 | bool was_accelerated_compositing_ever_active_; |
| 716 | |
[email protected] | 350ce870 | 2012-03-09 04:23:38 | [diff] [blame] | 717 | base::OneShotTimer<RenderWidget> animation_timer_; |
[email protected] | 5f8b102 | 2011-01-21 23:34:50 | [diff] [blame] | 718 | base::Time animation_floor_time_; |
| 719 | bool animation_update_pending_; |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 720 | bool invalidation_task_posted_; |
[email protected] | 5f8b102 | 2011-01-21 23:34:50 | [diff] [blame] | 721 | |
[email protected] | bd37ae25 | 2011-06-03 01:28:18 | [diff] [blame] | 722 | bool has_disable_gpu_vsync_switch_; |
[email protected] | 0fb93f5 | 2011-05-18 23:13:56 | [diff] [blame] | 723 | base::TimeTicks last_do_deferred_update_time_; |
| 724 | |
[email protected] | c1e6cc06 | 2013-08-24 03:35:35 | [diff] [blame] | 725 | // Stats for legacy software mode |
| 726 | scoped_ptr<cc::RenderingStatsInstrumentation> legacy_software_mode_stats_; |
[email protected] | fef5e397 | 2012-08-07 03:59:47 | [diff] [blame] | 727 | |
[email protected] | aa4117f | 2011-12-09 22:19:21 | [diff] [blame] | 728 | // UpdateRect parameters for the current compositing pass. This is used to |
| 729 | // pass state between DoDeferredUpdate and OnSwapBuffersPosted. |
| 730 | scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; |
| 731 | |
| 732 | // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to |
| 733 | // delay sending of UpdateRect until the corresponding SwapBuffers has been |
| 734 | // executed. Since we can have several in flight, we need to keep them in a |
| 735 | // queue. Note: some SwapBuffers may not correspond to an update, in which |
| 736 | // case NULL is added to the queue. |
| 737 | std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; |
| 738 | |
[email protected] | 842f1065 | 2012-06-06 01:54:04 | [diff] [blame] | 739 | // Properties of the screen hosting this RenderWidget instance. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 740 | blink::WebScreenInfo screen_info_; |
[email protected] | 842f1065 | 2012-06-06 01:54:04 | [diff] [blame] | 741 | |
[email protected] | f1cccb3 | 2012-06-06 18:29:59 | [diff] [blame] | 742 | // The device scale factor. This value is computed from the DPI entries in |
| 743 | // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
[email protected] | faec7b1 | 2012-06-19 14:42:13 | [diff] [blame] | 744 | float device_scale_factor_; |
[email protected] | f1cccb3 | 2012-06-06 18:29:59 | [diff] [blame] | 745 | |
[email protected] | 9017d785 | 2013-11-21 17:47:35 | [diff] [blame] | 746 | // State associated with synthetic gestures. Synthetic gestures are processed |
| 747 | // in-order, so a queue is sufficient to identify the correct state for a |
| 748 | // completed gesture. |
| 749 | std::queue<SyntheticGestureCompletionCallback> |
| 750 | pending_synthetic_gesture_callbacks_; |
[email protected] | 0e241b4b | 2012-08-18 09:06:27 | [diff] [blame] | 751 | |
[email protected] | cb643093 | 2012-10-31 00:53:36 | [diff] [blame] | 752 | // Specified whether the compositor will run in its own thread. |
| 753 | bool is_threaded_compositing_enabled_; |
| 754 | |
[email protected] | 256737c | 2013-06-08 04:39:10 | [diff] [blame] | 755 | // The latency information for any current non-accelerated-compositing |
| 756 | // frame. |
[email protected] | 98a0447 | 2013-12-23 20:42:50 | [diff] [blame] | 757 | std::vector<ui::LatencyInfo> latency_info_; |
[email protected] | 256737c | 2013-06-08 04:39:10 | [diff] [blame] | 758 | |
[email protected] | 53b4cc1 | 2013-07-18 23:02:30 | [diff] [blame] | 759 | uint32 next_output_surface_id_; |
| 760 | |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 761 | #if defined(OS_ANDROID) |
[email protected] | 90f2415 | 2014-04-09 12:41:36 | [diff] [blame] | 762 | // Indicates value in the focused text field is in dirty state, i.e. modified |
| 763 | // by script etc., not by user input. |
| 764 | bool text_field_is_dirty_; |
| 765 | |
[email protected] | 0d1ebed1 | 2013-08-05 22:01:13 | [diff] [blame] | 766 | // A counter for number of outstanding messages from the renderer to the |
| 767 | // browser regarding IME-type events that have not been acknowledged by the |
| 768 | // browser. If this value is not 0 IME events will be dropped. |
| 769 | int outstanding_ime_acks_; |
| 770 | #endif |
| 771 | |
[email protected] | b2e4c7013 | 2013-10-03 02:07:51 | [diff] [blame] | 772 | scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; |
| 773 | |
| 774 | // Popups may be displaced when screen metrics emulation is enabled. |
| 775 | // These values are used to properly adjust popup position. |
| 776 | gfx::Point popup_view_origin_for_emulation_; |
| 777 | gfx::Point popup_screen_origin_for_emulation_; |
| 778 | float popup_origin_scale_for_emulation_; |
| 779 | |
[email protected] | 5b45ad4 | 2013-10-25 00:42:04 | [diff] [blame] | 780 | scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
| 781 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 782 | // A list of swapped out RenderFrames that need to be notified |
| 783 | // of compositing-related events (e.g. DidCommitCompositorFrame). |
| 784 | ObserverList<RenderFrameImpl> swapped_out_frames_; |
| 785 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 786 | ui::MenuSourceType context_menu_source_type_; |
| 787 | gfx::Point touch_editing_context_menu_location_; |
| 788 | |
[email protected] | 05d47875 | 2009-04-08 23:38:16 | [diff] [blame] | 789 | DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 790 | }; |
| 791 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 792 | } // namespace content |
| 793 | |
[email protected] | 2cff005 | 2011-03-18 16:51:44 | [diff] [blame] | 794 | #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |