1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_
11 #include "base/auto_reset.h"
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "base/observer_list.h"
17 #include "base/time/time.h"
18 #include "base/timer/timer.h"
19 #include "cc/debug/rendering_stats_instrumentation.h"
20 #include "content/common/content_export.h"
21 #include "content/common/cursors/webcursor.h"
22 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
23 #include "content/common/input/synthetic_gesture_params.h"
24 #include "ipc/ipc_listener.h"
25 #include "ipc/ipc_sender.h"
26 #include "third_party/WebKit/public/platform/WebRect.h"
27 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
28 #include "third_party/WebKit/public/web/WebInputEvent.h"
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"
32 #include "third_party/WebKit/public/web/WebTouchAction.h"
33 #include "third_party/WebKit/public/web/WebWidget.h"
34 #include "third_party/WebKit/public/web/WebWidgetClient.h"
35 #include "third_party/skia/include/core/SkBitmap.h"
36 #include "ui/base/ime/text_input_mode.h"
37 #include "ui/base/ime/text_input_type.h"
38 #include "ui/base/ui_base_types.h"
39 #include "ui/gfx/native_widget_types.h"
40 #include "ui/gfx/range/range.h"
41 #include "ui/gfx/rect.h"
42 #include "ui/gfx/vector2d.h"
43 #include "ui/gfx/vector2d_f.h"
44 #include "ui/surface/transport_dib.h"
46 struct ViewHostMsg_UpdateRect_Params;
47 struct ViewMsg_Resize_Params;
48 class ViewHostMsg_UpdateRect;
55 struct WebDeviceEmulationParams;
56 class WebGestureEvent;
57 class WebKeyboardEvent;
62 namespace cc { class OutputSurface; }
69 class ExternalPopupMenu;
70 class PepperPluginInstanceImpl;
71 class RenderFrameImpl;
72 class RenderFrameProxy;
73 class RenderWidgetCompositor;
74 class RenderWidgetTest;
75 class ResizingModeSelector;
76 struct ContextMenuParams;
77 struct WebPluginGeometry;
79 // RenderWidget provides a communication bridge between a WebWidget and
80 // a RenderWidgetHost, the latter of which lives in a different process.
81 class CONTENT_EXPORT RenderWidget
82 : public IPC::Listener,
84 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient),
85 public base::RefCounted<RenderWidget> {
87 // Creates a new RenderWidget. The opener_id is the routing ID of the
88 // RenderView that this widget lives inside.
89 static RenderWidget* Create(int32 opener_id,
90 blink::WebPopupType popup_type,
91 const blink::WebScreenInfo& screen_info);
93 // Creates a WebWidget based on the popup type.
94 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget);
96 int32 routing_id() const { return routing_id_; }
97 int32 surface_id() const { return surface_id_; }
98 blink::WebWidget* webwidget() const { return webwidget_; }
99 gfx::Size size() const { return size_; }
100 bool has_focus() const { return has_focus_; }
101 bool is_fullscreen() const { return is_fullscreen_; }
102 bool is_hidden() const { return is_hidden_; }
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_;
113 // Functions to track out-of-process frames for special notifications.
114 void RegisterRenderFrameProxy(RenderFrameProxy* proxy);
115 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy);
117 // Functions to track all RenderFrame objects associated with this
119 void RegisterRenderFrame(RenderFrameImpl* frame);
120 void UnregisterRenderFrame(RenderFrameImpl* frame);
122 #if defined(VIDEO_HOLE)
123 void RegisterVideoHoleFrame(RenderFrameImpl* frame);
124 void UnregisterVideoHoleFrame(RenderFrameImpl* frame);
125 #endif // defined(VIDEO_HOLE)
128 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
131 virtual bool Send(IPC::Message* msg) OVERRIDE;
133 // blink::WebWidgetClient
134 virtual void suppressCompositorScheduling(bool enable);
135 virtual void willBeginCompositorFrame();
136 virtual void didAutoResize(const blink::WebSize& new_size);
137 virtual void initializeLayerTreeView();
138 virtual blink::WebLayerTreeView* layerTreeView();
139 virtual void didBecomeReadyForAdditionalInput();
140 virtual void didCommitAndDrawCompositorFrame();
141 virtual void didCompleteSwapBuffers();
142 virtual void scheduleComposite();
143 virtual void didFocus();
144 virtual void didBlur();
145 virtual void didChangeCursor(const blink::WebCursorInfo&);
146 virtual void closeWidgetSoon();
147 virtual void show(blink::WebNavigationPolicy);
148 virtual void runModal() {}
149 virtual blink::WebRect windowRect();
150 virtual void setToolTipText(const blink::WebString& text,
151 blink::WebTextDirection hint);
152 virtual void setWindowRect(const blink::WebRect&);
153 virtual blink::WebRect windowResizerRect();
154 virtual blink::WebRect rootWindowRect();
155 virtual blink::WebScreenInfo screenInfo();
156 virtual float deviceScaleFactor();
157 virtual void resetInputMethod();
158 virtual void didHandleGestureEvent(const blink::WebGestureEvent& event,
159 bool event_cancelled);
161 // Begins the compositor's scheduler to start producing frames.
162 void StartCompositor();
164 // Called when a plugin is moved. These events are queued up and sent with
165 // the next paint or scroll message to the host.
166 void SchedulePluginMove(const WebPluginGeometry& move);
168 // Called when a plugin window has been destroyed, to make sure the currently
169 // pending moves don't try to reference it.
170 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window);
172 RenderWidgetCompositor* compositor() const;
174 const ui::LatencyInfo* current_event_latency_info() const {
175 return current_event_latency_info_;
178 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback);
180 // Callback for use with synthetic gestures (e.g. BeginSmoothScroll).
181 typedef base::Callback<void()> SyntheticGestureCompletionCallback;
183 // Send a synthetic gesture to the browser to be queued to the synthetic
184 // gesture controller.
185 void QueueSyntheticGesture(
186 scoped_ptr<SyntheticGestureParams> gesture_params,
187 const SyntheticGestureCompletionCallback& callback);
189 // Close the underlying WebWidget.
190 virtual void Close();
192 // Notifies about a compositor frame commit operation having finished.
193 virtual void DidCommitCompositorFrame();
195 // Handle common setup/teardown for handling IME events.
196 void StartHandlingImeEvent();
197 void FinishHandlingImeEvent();
199 // Returns whether we currently should handle an IME event.
200 bool ShouldHandleImeEvent();
202 virtual void InstrumentWillBeginFrame(int frame_id) {}
203 virtual void InstrumentDidBeginFrame() {}
204 virtual void InstrumentDidCancelFrame() {}
205 virtual void InstrumentWillComposite() {}
207 // When paused in debugger, we send ack for mouse event early. This ensures
208 // that we continue receiving mouse moves and pass them to debugger. Returns
209 // whether we are paused in mouse move event and have sent the ack.
210 bool SendAckForMouseMoveFromDebugger();
212 // When resumed from pause in debugger while handling mouse move,
213 // we should not send an extra ack (see SendAckForMouseMoveFromDebugger).
214 void IgnoreAckForMouseMoveFromDebugger();
216 // ScreenMetricsEmulator class manages screen emulation inside a render
217 // widget. This includes resizing, placing view on the screen at desired
218 // position, changing device scale factor, and scaling down the whole
219 // widget if required to fit into the browser window.
220 class ScreenMetricsEmulator;
222 // Emulates screen and widget metrics. Supplied values override everything
224 void EnableScreenMetricsEmulation(
225 const blink::WebDeviceEmulationParams& params);
226 void DisableScreenMetricsEmulation();
227 void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator);
229 void ScheduleCompositeWithForcedRedraw();
231 // Called by the compositor in single-threaded mode when a swap is posted,
232 // completes or is aborted.
233 void OnSwapBuffersPosted();
234 void OnSwapBuffersComplete();
235 void OnSwapBuffersAborted();
237 // Checks if the selection bounds have been changed. If they are changed,
238 // the new value will be sent to the browser process.
239 void UpdateSelectionBounds();
241 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end);
243 void OnShowHostContextMenu(ContextMenuParams* params);
255 // |show_ime| should be SHOW_IME_IF_NEEDED iff the update may cause the ime to
256 // be displayed, e.g. after a tap on an input field on mobile.
257 // |change_source| should be FROM_NON_IME when the renderer has to wait for
258 // the browser to acknowledge the change before the renderer handles any more
259 // IME events. This is when the text change did not originate from the IME in
260 // the browser side, such as changes by JavaScript or autofill.
261 void UpdateTextInputState(ShowIme show_ime, ChangeSource change_source);
263 #if defined(OS_MACOSX) || defined(USE_AURA)
264 // Checks if the composition range or composition character bounds have been
265 // changed. If they are changed, the new value will be sent to the browser
267 void UpdateCompositionInfo(bool should_update_range);
270 #if defined(OS_ANDROID)
271 void DidChangeBodyBackgroundColor(SkColor bg_color);
275 // Friend RefCounted so that the dtor can be non-public. Using this class
276 // without ref-counting is an error.
277 friend class base::RefCounted<RenderWidget>;
279 friend class RenderWidgetTest;
286 RenderWidget(blink::WebPopupType popup_type,
287 const blink::WebScreenInfo& screen_info,
292 virtual ~RenderWidget();
294 // Initializes this view with the given opener. CompleteInit must be called
296 bool Init(int32 opener_id);
298 // Called by Init and subclasses to perform initialization.
299 bool DoInit(int32 opener_id,
300 blink::WebWidget* web_widget,
301 IPC::SyncMessage* create_widget_message);
303 // Finishes creation of a pending view started with Init.
306 // Sets whether this RenderWidget has been swapped out to be displayed by
307 // a RenderWidget in a different process. If so, no new IPC messages will be
308 // sent (only ACKs) and the process is free to exit when there are no other
309 // active RenderWidgets.
310 void SetSwappedOut(bool is_swapped_out);
312 void FlushPendingInputEventAck();
313 void DoDeferredClose();
314 void DoDeferredSetWindowRect(const blink::WebRect& pos);
316 // Resizes the render widget.
317 void Resize(const gfx::Size& new_size,
318 const gfx::Size& physical_backing_size,
319 float overdraw_bottom_height,
320 const gfx::Size& visible_viewport_size,
321 const gfx::Rect& resizer_rect,
323 ResizeAck resize_ack);
324 // Used to force the size of a window when running layout tests.
325 void ResizeSynchronously(const gfx::Rect& new_position);
326 virtual void SetScreenMetricsEmulationParameters(
327 float device_scale_factor,
328 const gfx::Point& root_layer_offset,
329 float root_layer_scale);
330 #if defined(OS_MACOSX) || defined(OS_ANDROID)
331 void SetExternalPopupOriginAdjustmentsForEmulation(
332 ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator);
335 // RenderWidget IPC message handlers
336 void OnHandleInputEvent(const blink::WebInputEvent* event,
337 const ui::LatencyInfo& latency_info,
338 bool keyboard_shortcut);
339 void OnCursorVisibilityChange(bool is_visible);
340 void OnMouseCaptureLost();
341 virtual void OnSetFocus(bool enable);
342 virtual void OnClose();
343 void OnCreatingNewAck();
344 virtual void OnResize(const ViewMsg_Resize_Params& params);
345 void OnChangeResizeRect(const gfx::Rect& resizer_rect);
346 virtual void OnWasHidden();
347 virtual void OnWasShown(bool needs_repainting);
348 virtual void OnWasSwappedOut();
349 void OnCreateVideoAck(int32 video_id);
350 void OnUpdateVideoAck(int32 video_id);
351 void OnRequestMoveAck();
352 void OnSetInputMethodActive(bool is_active);
353 void OnCandidateWindowShown();
354 void OnCandidateWindowUpdated();
355 void OnCandidateWindowHidden();
356 virtual void OnImeSetComposition(
357 const base::string16& text,
358 const std::vector<blink::WebCompositionUnderline>& underlines,
361 virtual void OnImeConfirmComposition(const base::string16& text,
362 const gfx::Range& replacement_range,
363 bool keep_selection);
364 void OnRepaint(gfx::Size size_to_paint);
365 void OnSyntheticGestureCompleted();
366 void OnSetTextDirection(blink::WebTextDirection direction);
368 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
369 const gfx::Rect& window_screen_rect);
370 #if defined(OS_ANDROID)
371 void OnShowImeIfNeeded();
373 // Whenever an IME event that needs an acknowledgement is sent to the browser,
374 // the number of outstanding IME events that needs acknowledgement should be
375 // incremented. All IME events will be dropped until we receive an ack from
377 void IncrementOutstandingImeEventAcks();
379 // Called by the browser process for every required IME acknowledgement.
380 void OnImeEventAck();
383 // Notify the compositor about a change in viewport size. This should be
384 // used only with auto resize mode WebWidgets, as normal WebWidgets should
385 // go through OnResize.
386 void AutoResizeCompositor();
388 virtual void SetDeviceScaleFactor(float device_scale_factor);
389 virtual bool SetDeviceColorProfile(const std::vector<char>& color_profile);
391 virtual void OnOrientationChange();
393 // Override points to notify derived classes that a paint has happened.
394 // DidInitiatePaint happens when that has completed, and subsequent rendering
395 // won't affect the painted content. DidFlushPaint happens once we've received
396 // the ACK that the screen has been updated. For a given paint operation,
397 // these overrides will always be called in the order DidInitiatePaint,
399 virtual void DidInitiatePaint() {}
400 virtual void DidFlushPaint() {}
402 virtual GURL GetURLForGraphicsContext3D();
404 // Gets the scroll offset of this widget, if this widget has a notion of
406 virtual gfx::Vector2d GetScrollOffset();
408 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
409 // use this method so that we can properly inform the RenderThread of our
411 void SetHidden(bool hidden);
413 void WillToggleFullscreen();
414 void DidToggleFullscreen();
416 bool next_paint_is_resize_ack() const;
417 void set_next_paint_is_resize_ack();
418 void set_next_paint_is_repaint_ack();
420 // Override point to obtain that the current input method state and caret
422 virtual ui::TextInputType GetTextInputType();
423 virtual ui::TextInputType WebKitToUiTextInputType(
424 blink::WebTextInputType type);
426 #if defined(OS_MACOSX) || defined(USE_AURA)
427 // Override point to obtain that the current composition character bounds.
428 // In the case of surrogate pairs, the character is treated as two characters:
429 // the bounds for first character is actual one, and the bounds for second
430 // character is zero width rectangle.
431 virtual void GetCompositionCharacterBounds(
432 std::vector<gfx::Rect>* character_bounds);
434 // Returns the range of the text that is being composed or the selection if
435 // the composition does not exist.
436 virtual void GetCompositionRange(gfx::Range* range);
438 // Returns true if the composition range or composition character bounds
439 // should be sent to the browser process.
440 bool ShouldUpdateCompositionInfo(
441 const gfx::Range& range,
442 const std::vector<gfx::Rect>& bounds);
445 // Override point to obtain that the current input method state about
447 virtual bool CanComposeInline();
449 // Tells the renderer it does not have focus. Used to prevent us from getting
450 // the focus on our own when the browser did not focus us.
453 // Set the pending window rect.
454 // Because the real render_widget is hosted in another process, there is
455 // a time period where we may have set a new window rect which has not yet
456 // been processed by the browser. So we maintain a pending window rect
457 // size. If JS code sets the WindowRect, and then immediately calls
458 // GetWindowRect() we'll use this pending window rect as the size.
459 void SetPendingWindowRect(const blink::WebRect& r);
461 // Called by OnHandleInputEvent() to notify subclasses that a key event was
463 virtual void DidHandleKeyEvent() {}
465 // Called by OnHandleInputEvent() to notify subclasses that a mouse event is
466 // about to be handled.
467 // Returns true if no further handling is needed. In that case, the event
468 // won't be sent to WebKit or trigger DidHandleMouseEvent().
469 virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event);
471 // Called by OnHandleInputEvent() to notify subclasses that a gesture event is
472 // about to be handled.
473 // Returns true if no further handling is needed. In that case, the event
474 // won't be sent to WebKit.
475 virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event);
477 // Called by OnHandleInputEvent() to notify subclasses that a mouse event was
479 virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {}
481 // Called by OnHandleInputEvent() to notify subclasses that a touch event was
483 virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {}
485 // Check whether the WebWidget has any touch event handlers registered
486 // at the given point.
487 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const;
489 // Check whether the WebWidget has any touch event handlers registered.
490 virtual void hasTouchEventHandlers(bool has_handlers);
492 // Tell the browser about the actions permitted for a new touch point.
493 virtual void setTouchAction(blink::WebTouchAction touch_action);
495 // Called when value of focused text field gets dirty, e.g. value is modified
496 // by script, not by user input.
497 virtual void didUpdateTextOfFocusedElementByNonUserInput();
499 // Creates a 3D context associated with this view.
500 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D();
502 // Routing ID that allows us to communicate to the parent browser process
503 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
508 // We are responsible for destroying this object via its Close method.
509 // May be NULL when the window is closing.
510 blink::WebWidget* webwidget_;
512 // This is lazily constructed and must not outlive webwidget_.
513 scoped_ptr<RenderWidgetCompositor> compositor_;
515 // Set to the ID of the view that initiated creating this view, if any. When
516 // the view was initiated by the browser (the common case), this will be
517 // MSG_ROUTING_NONE. This is used in determining ownership when opening
518 // child tabs. See RenderWidget::createWebViewWithRequest.
520 // This ID may refer to an invalid view if that view is closed before this
524 // The position where this view should be initially shown.
525 gfx::Rect initial_pos_;
529 // We store the current cursor object so we can avoid spamming SetCursor
531 WebCursor current_cursor_;
533 // The size of the RenderWidget.
536 // The size of the view's backing surface in non-DPI-adjusted pixels.
537 gfx::Size physical_backing_size_;
539 // The height of the physical backing surface that is overdrawn opaquely in
540 // the browser, for example by an on-screen-keyboard (in DPI-adjusted pixels).
541 float overdraw_bottom_height_;
543 // The size of the visible viewport in DPI-adjusted pixels.
544 gfx::Size visible_viewport_size_;
546 // The area that must be reserved for drawing the resize corner.
547 gfx::Rect resizer_rect_;
549 // Flags for the next ViewHostMsg_UpdateRect message.
550 int next_paint_flags_;
552 // Whether the WebWidget is in auto resize mode, which is used for example
553 // by extension popups.
554 bool auto_resize_mode_;
556 // True if we need to send an UpdateRect message to notify the browser about
557 // an already-completed auto-resize.
558 bool need_update_rect_for_auto_resize_;
560 // Set to true if we should ignore RenderWidget::Show calls.
563 // Indicates that we shouldn't bother generated paint events.
566 // Indicates that we are never visible, so never produce graphical output.
569 // Indicates that we are in fullscreen mode.
572 // Indicates whether we have been focused/unfocused by the browser.
575 // Are we currently handling an input event?
576 bool handling_input_event_;
578 // Are we currently handling an ime event?
579 bool handling_ime_event_;
581 // Type of the input event we are currently handling.
582 blink::WebInputEvent::Type handling_event_type_;
584 // Whether we should not send ack for the current mouse move.
585 bool ignore_ack_for_mouse_move_from_debugger_;
587 // True if we have requested this widget be closed. No more messages will
588 // be sent, except for a Close.
591 // Whether this RenderWidget is currently swapped out, such that the view is
592 // being rendered by another process. If all RenderWidgets in a process are
593 // swapped out, the process can exit.
594 bool is_swapped_out_;
596 // Indicates if an input method is active in the browser process.
597 bool input_method_is_active_;
599 // Stores information about the current text input.
600 blink::WebTextInputInfo text_input_info_;
602 // Stores the current text input type of |webwidget_|.
603 ui::TextInputType text_input_type_;
605 // Stores the current text input mode of |webwidget_|.
606 ui::TextInputMode text_input_mode_;
608 // Stores the current type of composition text rendering of |webwidget_|.
609 bool can_compose_inline_;
611 // Stores the current selection bounds.
612 gfx::Rect selection_focus_rect_;
613 gfx::Rect selection_anchor_rect_;
615 // Stores the current composition character bounds.
616 std::vector<gfx::Rect> composition_character_bounds_;
618 // Stores the current composition range.
619 gfx::Range composition_range_;
621 // The kind of popup this widget represents, NONE if not a popup.
622 blink::WebPopupType popup_type_;
624 // Holds all the needed plugin window moves for a scroll.
625 typedef std::vector<WebPluginGeometry> WebPluginGeometryVector;
626 WebPluginGeometryVector plugin_window_moves_;
628 // While we are waiting for the browser to update window sizes, we track the
629 // pending size temporarily.
630 int pending_window_rect_count_;
631 blink::WebRect pending_window_rect_;
633 // The screen rects of the view and the window that contains it.
634 gfx::Rect view_screen_rect_;
635 gfx::Rect window_screen_rect_;
637 scoped_ptr<IPC::Message> pending_input_event_ack_;
639 // The time spent in input handlers this frame. Used to throttle input acks.
640 base::TimeDelta total_input_handling_time_this_frame_;
642 // Indicates if the next sequence of Char events should be suppressed or not.
643 bool suppress_next_char_events_;
645 // Properties of the screen hosting this RenderWidget instance.
646 blink::WebScreenInfo screen_info_;
648 // The device scale factor. This value is computed from the DPI entries in
649 // |screen_info_| on some platforms, and defaults to 1 on other platforms.
650 float device_scale_factor_;
652 // The device color profile on supported platforms.
653 std::vector<char> device_color_profile_;
655 // State associated with synthetic gestures. Synthetic gestures are processed
656 // in-order, so a queue is sufficient to identify the correct state for a
657 // completed gesture.
658 std::queue<SyntheticGestureCompletionCallback>
659 pending_synthetic_gesture_callbacks_;
661 // Specified whether the compositor will run in its own thread.
662 bool is_threaded_compositing_enabled_;
664 const ui::LatencyInfo* current_event_latency_info_;
666 uint32 next_output_surface_id_;
668 #if defined(OS_ANDROID)
669 // Indicates value in the focused text field is in dirty state, i.e. modified
670 // by script etc., not by user input.
671 bool text_field_is_dirty_;
673 // A counter for number of outstanding messages from the renderer to the
674 // browser regarding IME-type events that have not been acknowledged by the
675 // browser. If this value is not 0 IME events will be dropped.
676 int outstanding_ime_acks_;
678 // The background color of the document body element. This is used as the
679 // default background color for filling the screen areas for which we don't
680 // have the actual content.
681 SkColor body_background_color_;
684 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_;
686 // Popups may be displaced when screen metrics emulation is enabled.
687 // These values are used to properly adjust popup position.
688 gfx::Point popup_view_origin_for_emulation_;
689 gfx::Point popup_screen_origin_for_emulation_;
690 float popup_origin_scale_for_emulation_;
692 scoped_ptr<ResizingModeSelector> resizing_mode_selector_;
694 // Lists of RenderFrameProxy objects that need to be notified of
695 // compositing-related events (e.g. DidCommitCompositorFrame).
696 ObserverList<RenderFrameProxy> render_frame_proxies_;
697 #if defined(VIDEO_HOLE)
698 ObserverList<RenderFrameImpl> video_hole_frames_;
699 #endif // defined(VIDEO_HOLE)
701 // A list of RenderFrames associated with this RenderWidget. Notifications
702 // are sent to each frame in the list for events such as changing
703 // visibility state for example.
704 ObserverList<RenderFrameImpl> render_frames_;
706 ui::MenuSourceType context_menu_source_type_;
707 gfx::Point touch_editing_context_menu_location_;
709 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
712 } // namespace content
714 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_