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/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
17 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
18 #include "cc/debug/rendering_stats_instrumentation.h" | 19 #include "cc/debug/rendering_stats_instrumentation.h" |
19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
20 #include "content/common/cursors/webcursor.h" | 21 #include "content/common/cursors/webcursor.h" |
21 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 22 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 60 } |
60 | 61 |
61 namespace cc { class OutputSurface; } | 62 namespace cc { class OutputSurface; } |
62 | 63 |
63 namespace gfx { | 64 namespace gfx { |
64 class Range; | 65 class Range; |
65 } | 66 } |
66 | 67 |
67 namespace content { | 68 namespace content { |
68 class ExternalPopupMenu; | 69 class ExternalPopupMenu; |
| 70 class FrameSwapMessageQueue; |
69 class PepperPluginInstanceImpl; | 71 class PepperPluginInstanceImpl; |
70 class RenderFrameImpl; | 72 class RenderFrameImpl; |
71 class RenderWidgetCompositor; | 73 class RenderWidgetCompositor; |
72 class RenderWidgetTest; | 74 class RenderWidgetTest; |
73 class ResizingModeSelector; | 75 class ResizingModeSelector; |
74 struct ContextMenuParams; | 76 struct ContextMenuParams; |
75 struct WebPluginGeometry; | 77 struct WebPluginGeometry; |
76 | 78 |
77 // RenderWidget provides a communication bridge between a WebWidget and | 79 // RenderWidget provides a communication bridge between a WebWidget and |
78 // a RenderWidgetHost, the latter of which lives in a different process. | 80 // a RenderWidgetHost, the latter of which lives in a different process. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 void QueueSyntheticGesture( | 171 void QueueSyntheticGesture( |
170 scoped_ptr<SyntheticGestureParams> gesture_params, | 172 scoped_ptr<SyntheticGestureParams> gesture_params, |
171 const SyntheticGestureCompletionCallback& callback); | 173 const SyntheticGestureCompletionCallback& callback); |
172 | 174 |
173 // Close the underlying WebWidget. | 175 // Close the underlying WebWidget. |
174 virtual void Close(); | 176 virtual void Close(); |
175 | 177 |
176 // Notifies about a compositor frame commit operation having finished. | 178 // Notifies about a compositor frame commit operation having finished. |
177 virtual void DidCommitCompositorFrame(); | 179 virtual void DidCommitCompositorFrame(); |
178 | 180 |
| 181 // If the RenderWidget doesn't need a commit this is equivalent to Send, |
| 182 // otherwise this will make sure |msg| is delivered with a frame swap |
| 183 // coresponding to the commit that is about to occur. |
| 184 // |
| 185 // |msg| message to send, ownership of |msg| is transferred. |
| 186 void QueueMessage(IPC::Message* msg); |
| 187 |
179 // Handle common setup/teardown for handling IME events. | 188 // Handle common setup/teardown for handling IME events. |
180 void StartHandlingImeEvent(); | 189 void StartHandlingImeEvent(); |
181 void FinishHandlingImeEvent(); | 190 void FinishHandlingImeEvent(); |
182 | 191 |
183 // Returns whether we currently should handle an IME event. | 192 // Returns whether we currently should handle an IME event. |
184 bool ShouldHandleImeEvent(); | 193 bool ShouldHandleImeEvent(); |
185 | 194 |
186 virtual void InstrumentWillBeginFrame(int frame_id) {} | 195 virtual void InstrumentWillBeginFrame(int frame_id) {} |
187 virtual void InstrumentDidBeginFrame() {} | 196 virtual void InstrumentDidBeginFrame() {} |
188 virtual void InstrumentDidCancelFrame() {} | 197 virtual void InstrumentDidCancelFrame() {} |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 #endif // defined(OS_MACOSX) | 689 #endif // defined(OS_MACOSX) |
681 | 690 |
682 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; | 691 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; |
683 | 692 |
684 // Popups may be displaced when screen metrics emulation is enabled. | 693 // Popups may be displaced when screen metrics emulation is enabled. |
685 // These values are used to properly adjust popup position. | 694 // These values are used to properly adjust popup position. |
686 gfx::Point popup_view_origin_for_emulation_; | 695 gfx::Point popup_view_origin_for_emulation_; |
687 gfx::Point popup_screen_origin_for_emulation_; | 696 gfx::Point popup_screen_origin_for_emulation_; |
688 float popup_origin_scale_for_emulation_; | 697 float popup_origin_scale_for_emulation_; |
689 | 698 |
| 699 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; |
690 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; | 700 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
691 | 701 |
692 // A list of swapped out RenderFrames that need to be notified | 702 // A list of swapped out RenderFrames that need to be notified |
693 // of compositing-related events (e.g. DidCommitCompositorFrame). | 703 // of compositing-related events (e.g. DidCommitCompositorFrame). |
694 ObserverList<RenderFrameImpl> swapped_out_frames_; | 704 ObserverList<RenderFrameImpl> swapped_out_frames_; |
695 | 705 |
696 ui::MenuSourceType context_menu_source_type_; | 706 ui::MenuSourceType context_menu_source_type_; |
697 gfx::Point touch_editing_context_menu_location_; | 707 gfx::Point touch_editing_context_menu_location_; |
698 | 708 |
699 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 709 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
700 }; | 710 }; |
701 | 711 |
702 } // namespace content | 712 } // namespace content |
703 | 713 |
704 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 714 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |