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/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
17 #include "cc/debug/rendering_stats_instrumentation.h" | 17 #include "cc/debug/rendering_stats_instrumentation.h" |
18 #include "content/common/browser_rendering_stats.h" | 18 #include "content/common/browser_rendering_stats.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 20 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 21 #include "content/common/input/synthetic_gesture_params.h" |
21 #include "content/renderer/paint_aggregator.h" | 22 #include "content/renderer/paint_aggregator.h" |
22 #include "ipc/ipc_listener.h" | 23 #include "ipc/ipc_listener.h" |
23 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
24 #include "third_party/WebKit/public/platform/WebRect.h" | 25 #include "third_party/WebKit/public/platform/WebRect.h" |
25 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 26 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
26 #include "third_party/WebKit/public/web/WebPopupType.h" | 27 #include "third_party/WebKit/public/web/WebPopupType.h" |
27 #include "third_party/WebKit/public/web/WebTextDirection.h" | 28 #include "third_party/WebKit/public/web/WebTextDirection.h" |
28 #include "third_party/WebKit/public/web/WebTextInputInfo.h" | 29 #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
29 #include "third_party/WebKit/public/web/WebWidget.h" | 30 #include "third_party/WebKit/public/web/WebWidget.h" |
30 #include "third_party/WebKit/public/web/WebWidgetClient.h" | 31 #include "third_party/WebKit/public/web/WebWidgetClient.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 172 |
172 void GetBrowserRenderingStats(BrowserRenderingStats* stats); | 173 void GetBrowserRenderingStats(BrowserRenderingStats* stats); |
173 | 174 |
174 RenderWidgetCompositor* compositor() const; | 175 RenderWidgetCompositor* compositor() const; |
175 | 176 |
176 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback); | 177 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback); |
177 | 178 |
178 // Callback for use with synthetic gestures (e.g. BeginSmoothScroll). | 179 // Callback for use with synthetic gestures (e.g. BeginSmoothScroll). |
179 typedef base::Callback<void()> SyntheticGestureCompletionCallback; | 180 typedef base::Callback<void()> SyntheticGestureCompletionCallback; |
180 | 181 |
181 // Directs the host to begin a smooth scroll. This scroll should have the same | 182 // Send a synthetic gesture to the browser to be queued to the synthetic |
182 // performance characteristics as a user-initiated scroll. Returns an ID of | 183 // gesture controller. |
183 // the scroll gesture. |mouse_event_x| and |mouse_event_y| are expected to be | 184 void QueueSyntheticGesture( |
184 // in local DIP coordinates. | 185 scoped_ptr<SyntheticGestureParams> gesture_params, |
185 void BeginSmoothScroll(bool scroll_down, | 186 const SyntheticGestureCompletionCallback& callback); |
186 const SyntheticGestureCompletionCallback& callback, | |
187 int pixels_to_scroll, | |
188 int mouse_event_x, | |
189 int mouse_event_y); | |
190 | |
191 // Directs the host to begin a pinch gesture. This gesture should have the | |
192 // same performance characteristics as a user-initiated pinch. | |
193 // |pixels_to_move|, |anchor_x| and |anchor_y| are expected to be in local | |
194 // DIP coordinates. | |
195 void BeginPinch(bool zoom_in, | |
196 int pixels_to_move, | |
197 int anchor_x, | |
198 int anchor_y, | |
199 const SyntheticGestureCompletionCallback& callback); | |
200 | 187 |
201 // Close the underlying WebWidget. | 188 // Close the underlying WebWidget. |
202 virtual void Close(); | 189 virtual void Close(); |
203 | 190 |
204 // Notifies about a compositor frame commit operation having finished. | 191 // Notifies about a compositor frame commit operation having finished. |
205 virtual void DidCommitCompositorFrame(); | 192 virtual void DidCommitCompositorFrame(); |
206 | 193 |
207 float filtered_time_per_frame() const { | 194 float filtered_time_per_frame() const { |
208 return filtered_time_per_frame_; | 195 return filtered_time_per_frame_; |
209 } | 196 } |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 // case NULL is added to the queue. | 736 // case NULL is added to the queue. |
750 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; | 737 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; |
751 | 738 |
752 // Properties of the screen hosting this RenderWidget instance. | 739 // Properties of the screen hosting this RenderWidget instance. |
753 blink::WebScreenInfo screen_info_; | 740 blink::WebScreenInfo screen_info_; |
754 | 741 |
755 // The device scale factor. This value is computed from the DPI entries in | 742 // The device scale factor. This value is computed from the DPI entries in |
756 // |screen_info_| on some platforms, and defaults to 1 on other platforms. | 743 // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
757 float device_scale_factor_; | 744 float device_scale_factor_; |
758 | 745 |
759 // State associated with the synthetic gestures function | 746 // State associated with synthetic gestures. Synthetic gestures are processed |
760 // (e.g. BeginSmoothScroll). | 747 // in-order, so a queue is sufficient to identify the correct state for a |
761 SyntheticGestureCompletionCallback pending_synthetic_gesture_; | 748 // completed gesture. |
| 749 std::queue<SyntheticGestureCompletionCallback> |
| 750 pending_synthetic_gesture_callbacks_; |
762 | 751 |
763 // Specified whether the compositor will run in its own thread. | 752 // Specified whether the compositor will run in its own thread. |
764 bool is_threaded_compositing_enabled_; | 753 bool is_threaded_compositing_enabled_; |
765 | 754 |
766 // The last set of rendering stats received from the browser. This is only | 755 // The last set of rendering stats received from the browser. This is only |
767 // received when using the --enable-gpu-benchmarking flag. | 756 // received when using the --enable-gpu-benchmarking flag. |
768 BrowserRenderingStats browser_rendering_stats_; | 757 BrowserRenderingStats browser_rendering_stats_; |
769 | 758 |
770 // The latency information for any current non-accelerated-compositing | 759 // The latency information for any current non-accelerated-compositing |
771 // frame. | 760 // frame. |
(...skipping 17 matching lines...) Expand all Loading... |
789 float popup_origin_scale_for_emulation_; | 778 float popup_origin_scale_for_emulation_; |
790 | 779 |
791 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; | 780 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
792 | 781 |
793 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 782 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
794 }; | 783 }; |
795 | 784 |
796 } // namespace content | 785 } // namespace content |
797 | 786 |
798 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 787 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |