OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
16 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
17 #include "base/time/time.h" | 18 #include "base/time/time.h" |
18 #include "base/timer/timer.h" | 19 #include "base/timer/timer.h" |
19 #include "cc/debug/rendering_stats_instrumentation.h" | 20 #include "cc/debug/rendering_stats_instrumentation.h" |
20 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
21 #include "content/common/cursors/webcursor.h" | 22 #include "content/common/cursors/webcursor.h" |
22 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 23 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
23 #include "content/common/input/synthetic_gesture_params.h" | 24 #include "content/common/input/synthetic_gesture_params.h" |
| 25 #include "content/renderer/message_delivery_policy.h" |
24 #include "ipc/ipc_listener.h" | 26 #include "ipc/ipc_listener.h" |
25 #include "ipc/ipc_sender.h" | 27 #include "ipc/ipc_sender.h" |
26 #include "third_party/WebKit/public/platform/WebRect.h" | 28 #include "third_party/WebKit/public/platform/WebRect.h" |
27 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 29 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
28 #include "third_party/WebKit/public/web/WebInputEvent.h" | 30 #include "third_party/WebKit/public/web/WebInputEvent.h" |
29 #include "third_party/WebKit/public/web/WebPopupType.h" | 31 #include "third_party/WebKit/public/web/WebPopupType.h" |
30 #include "third_party/WebKit/public/web/WebTextDirection.h" | 32 #include "third_party/WebKit/public/web/WebTextDirection.h" |
31 #include "third_party/WebKit/public/web/WebTextInputInfo.h" | 33 #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
32 #include "third_party/WebKit/public/web/WebTouchAction.h" | 34 #include "third_party/WebKit/public/web/WebTouchAction.h" |
33 #include "third_party/WebKit/public/web/WebWidget.h" | 35 #include "third_party/WebKit/public/web/WebWidget.h" |
(...skipping 26 matching lines...) Expand all Loading... |
60 } | 62 } |
61 | 63 |
62 namespace cc { class OutputSurface; } | 64 namespace cc { class OutputSurface; } |
63 | 65 |
64 namespace gfx { | 66 namespace gfx { |
65 class Range; | 67 class Range; |
66 } | 68 } |
67 | 69 |
68 namespace content { | 70 namespace content { |
69 class ExternalPopupMenu; | 71 class ExternalPopupMenu; |
| 72 class FrameSwapMessageQueue; |
70 class PepperPluginInstanceImpl; | 73 class PepperPluginInstanceImpl; |
71 class RenderFrameImpl; | 74 class RenderFrameImpl; |
72 class RenderWidgetCompositor; | 75 class RenderWidgetCompositor; |
73 class RenderWidgetTest; | 76 class RenderWidgetTest; |
74 class ResizingModeSelector; | 77 class ResizingModeSelector; |
75 struct ContextMenuParams; | 78 struct ContextMenuParams; |
76 struct WebPluginGeometry; | 79 struct WebPluginGeometry; |
77 | 80 |
78 // RenderWidget provides a communication bridge between a WebWidget and | 81 // RenderWidget provides a communication bridge between a WebWidget and |
79 // a RenderWidgetHost, the latter of which lives in a different process. | 82 // a RenderWidgetHost, the latter of which lives in a different process. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void QueueSyntheticGesture( | 187 void QueueSyntheticGesture( |
185 scoped_ptr<SyntheticGestureParams> gesture_params, | 188 scoped_ptr<SyntheticGestureParams> gesture_params, |
186 const SyntheticGestureCompletionCallback& callback); | 189 const SyntheticGestureCompletionCallback& callback); |
187 | 190 |
188 // Close the underlying WebWidget. | 191 // Close the underlying WebWidget. |
189 virtual void Close(); | 192 virtual void Close(); |
190 | 193 |
191 // Notifies about a compositor frame commit operation having finished. | 194 // Notifies about a compositor frame commit operation having finished. |
192 virtual void DidCommitCompositorFrame(); | 195 virtual void DidCommitCompositorFrame(); |
193 | 196 |
| 197 // Deliveres |message| together with compositor state change updates. The |
| 198 // exact behavior depends on |policy|. |
| 199 // |
| 200 // |msg| message to send, ownership of |msg| is transferred. |
| 201 // |policy| see the comment on MessageDeliveryPolicy. |
| 202 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy); |
| 203 |
194 // Handle common setup/teardown for handling IME events. | 204 // Handle common setup/teardown for handling IME events. |
195 void StartHandlingImeEvent(); | 205 void StartHandlingImeEvent(); |
196 void FinishHandlingImeEvent(); | 206 void FinishHandlingImeEvent(); |
197 | 207 |
198 // Returns whether we currently should handle an IME event. | 208 // Returns whether we currently should handle an IME event. |
199 bool ShouldHandleImeEvent(); | 209 bool ShouldHandleImeEvent(); |
200 | 210 |
201 virtual void InstrumentWillBeginFrame(int frame_id) {} | 211 virtual void InstrumentWillBeginFrame(int frame_id) {} |
202 virtual void InstrumentDidBeginFrame() {} | 212 virtual void InstrumentDidBeginFrame() {} |
203 virtual void InstrumentDidCancelFrame() {} | 213 virtual void InstrumentDidCancelFrame() {} |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 #endif | 693 #endif |
684 | 694 |
685 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; | 695 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; |
686 | 696 |
687 // Popups may be displaced when screen metrics emulation is enabled. | 697 // Popups may be displaced when screen metrics emulation is enabled. |
688 // These values are used to properly adjust popup position. | 698 // These values are used to properly adjust popup position. |
689 gfx::Point popup_view_origin_for_emulation_; | 699 gfx::Point popup_view_origin_for_emulation_; |
690 gfx::Point popup_screen_origin_for_emulation_; | 700 gfx::Point popup_screen_origin_for_emulation_; |
691 float popup_origin_scale_for_emulation_; | 701 float popup_origin_scale_for_emulation_; |
692 | 702 |
| 703 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
693 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; | 704 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
694 | 705 |
695 // Lists of swapped out RenderFrames that need to be notified | 706 // Lists of swapped out RenderFrames that need to be notified |
696 // of compositing-related events (e.g. DidCommitCompositorFrame). | 707 // of compositing-related events (e.g. DidCommitCompositorFrame). |
697 ObserverList<RenderFrameImpl> swapped_out_frames_; | 708 ObserverList<RenderFrameImpl> swapped_out_frames_; |
698 #if defined(VIDEO_HOLE) | 709 #if defined(VIDEO_HOLE) |
699 ObserverList<RenderFrameImpl> video_hole_frames_; | 710 ObserverList<RenderFrameImpl> video_hole_frames_; |
700 #endif // defined(VIDEO_HOLE) | 711 #endif // defined(VIDEO_HOLE) |
701 | 712 |
702 // A list of RenderFrames associated with this RenderWidget. Notifications | 713 // A list of RenderFrames associated with this RenderWidget. Notifications |
703 // are sent to each frame in the list for events such as changing | 714 // are sent to each frame in the list for events such as changing |
704 // visibility state for example. | 715 // visibility state for example. |
705 ObserverList<RenderFrameImpl> render_frames_; | 716 ObserverList<RenderFrameImpl> render_frames_; |
706 | 717 |
707 ui::MenuSourceType context_menu_source_type_; | 718 ui::MenuSourceType context_menu_source_type_; |
708 gfx::Point touch_editing_context_menu_location_; | 719 gfx::Point touch_editing_context_menu_location_; |
709 | 720 |
710 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 721 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
711 }; | 722 }; |
712 | 723 |
713 } // namespace content | 724 } // namespace content |
714 | 725 |
715 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 726 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |