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 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
28 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
29 #include "ui/base/ime/text_input_type.h" | 29 #include "ui/base/ime/text_input_type.h" |
30 #include "ui/base/range/range.h" | 30 #include "ui/base/range/range.h" |
31 #include "ui/gfx/native_widget_types.h" | 31 #include "ui/gfx/native_widget_types.h" |
32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
33 #include "ui/gfx/vector2d.h" | 33 #include "ui/gfx/vector2d.h" |
34 #include "ui/surface/transport_dib.h" | 34 #include "ui/surface/transport_dib.h" |
| 35 #include "webkit/compositor_bindings/web_latency_info_impl.h" |
35 #include "webkit/glue/webcursor.h" | 36 #include "webkit/glue/webcursor.h" |
36 | 37 |
37 struct ViewHostMsg_UpdateRect_Params; | 38 struct ViewHostMsg_UpdateRect_Params; |
38 class ViewHostMsg_UpdateRect; | 39 class ViewHostMsg_UpdateRect; |
39 | 40 |
40 namespace IPC { | 41 namespace IPC { |
41 class SyncMessage; | 42 class SyncMessage; |
42 } | 43 } |
43 | 44 |
44 namespace WebKit { | 45 namespace WebKit { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 bool is_hidden() const { return is_hidden_; } | 109 bool is_hidden() const { return is_hidden_; } |
109 | 110 |
110 // IPC::Listener | 111 // IPC::Listener |
111 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 112 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
112 | 113 |
113 // IPC::Sender | 114 // IPC::Sender |
114 virtual bool Send(IPC::Message* msg) OVERRIDE; | 115 virtual bool Send(IPC::Message* msg) OVERRIDE; |
115 | 116 |
116 // WebKit::WebWidgetClient | 117 // WebKit::WebWidgetClient |
117 virtual void willBeginCompositorFrame(); | 118 virtual void willBeginCompositorFrame(); |
| 119 virtual void didBeginCompositorFrame(); |
118 virtual void didInvalidateRect(const WebKit::WebRect&); | 120 virtual void didInvalidateRect(const WebKit::WebRect&); |
119 virtual void didScrollRect(int dx, int dy, | 121 virtual void didScrollRect(int dx, int dy, |
120 const WebKit::WebRect& clipRect); | 122 const WebKit::WebRect& clipRect); |
121 virtual void didAutoResize(const WebKit::WebSize& new_size); | 123 virtual void didAutoResize(const WebKit::WebSize& new_size); |
122 virtual void didActivateCompositor(int input_handler_identifier); | 124 virtual void didActivateCompositor(int input_handler_identifier); |
123 virtual void didDeactivateCompositor(); | 125 virtual void didDeactivateCompositor(); |
124 virtual void didBecomeReadyForAdditionalInput(); | 126 virtual void didBecomeReadyForAdditionalInput(); |
125 virtual void didCommitAndDrawCompositorFrame(); | 127 virtual void didCommitAndDrawCompositorFrame(); |
126 virtual void didCompleteSwapBuffers(); | 128 virtual void didCompleteSwapBuffers(); |
127 virtual void scheduleComposite(); | 129 virtual void scheduleComposite(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 const gfx::Rect& resizer_rect, | 260 const gfx::Rect& resizer_rect, |
259 bool is_fullscreen); | 261 bool is_fullscreen); |
260 void OnChangeResizeRect(const gfx::Rect& resizer_rect); | 262 void OnChangeResizeRect(const gfx::Rect& resizer_rect); |
261 virtual void OnWasHidden(); | 263 virtual void OnWasHidden(); |
262 virtual void OnWasShown(bool needs_repainting); | 264 virtual void OnWasShown(bool needs_repainting); |
263 virtual void OnWasSwappedOut(); | 265 virtual void OnWasSwappedOut(); |
264 void OnUpdateRectAck(); | 266 void OnUpdateRectAck(); |
265 void OnCreateVideoAck(int32 video_id); | 267 void OnCreateVideoAck(int32 video_id); |
266 void OnUpdateVideoAck(int32 video_id); | 268 void OnUpdateVideoAck(int32 video_id); |
267 void OnRequestMoveAck(); | 269 void OnRequestMoveAck(); |
268 void OnHandleInputEvent(const WebKit::WebInputEvent* event, | 270 void OnHandleInputEvent(int64 input_number, |
| 271 const WebKit::WebInputEvent* event, |
269 bool keyboard_shortcut); | 272 bool keyboard_shortcut); |
| 273 void OnStartFrame(int64 input_number); |
270 void OnMouseCaptureLost(); | 274 void OnMouseCaptureLost(); |
271 virtual void OnSetFocus(bool enable); | 275 virtual void OnSetFocus(bool enable); |
272 void OnSetInputMethodActive(bool is_active); | 276 void OnSetInputMethodActive(bool is_active); |
273 virtual void OnImeSetComposition( | 277 virtual void OnImeSetComposition( |
274 const string16& text, | 278 const string16& text, |
275 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 279 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
276 int selection_start, | 280 int selection_start, |
277 int selection_end); | 281 int selection_end); |
278 virtual void OnImeConfirmComposition( | 282 virtual void OnImeConfirmComposition( |
279 const string16& text, const ui::Range& replacement_range); | 283 const string16& text, const ui::Range& replacement_range); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) {} | 438 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) {} |
435 | 439 |
436 // Check whether the WebWidget has any touch event handlers registered | 440 // Check whether the WebWidget has any touch event handlers registered |
437 // at the given point. | 441 // at the given point. |
438 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; | 442 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; |
439 | 443 |
440 // Should return true if the underlying WebWidget is responsible for | 444 // Should return true if the underlying WebWidget is responsible for |
441 // the scheduling of compositing requests. | 445 // the scheduling of compositing requests. |
442 virtual bool WebWidgetHandlesCompositorScheduling() const; | 446 virtual bool WebWidgetHandlesCompositorScheduling() const; |
443 | 447 |
| 448 // Signal that a new frame is starting, for the purposes of keeping track of |
| 449 // frame latency. |
| 450 void StartingFrame(); |
| 451 |
444 // Routing ID that allows us to communicate to the parent browser process | 452 // Routing ID that allows us to communicate to the parent browser process |
445 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. | 453 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
446 int32 routing_id_; | 454 int32 routing_id_; |
447 | 455 |
448 int32 surface_id_; | 456 int32 surface_id_; |
449 | 457 |
450 // We are responsible for destroying this object via its Close method. | 458 // We are responsible for destroying this object via its Close method. |
451 WebKit::WebWidget* webwidget_; | 459 WebKit::WebWidget* webwidget_; |
452 | 460 |
453 // Set to the ID of the view that initiated creating this view, if any. When | 461 // Set to the ID of the view that initiated creating this view, if any. When |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 630 |
623 // State associated with the BeginSmoothScroll synthetic scrolling function. | 631 // State associated with the BeginSmoothScroll synthetic scrolling function. |
624 int next_smooth_scroll_gesture_id_; | 632 int next_smooth_scroll_gesture_id_; |
625 typedef std::map<int, SmoothScrollCompletionCallback> | 633 typedef std::map<int, SmoothScrollCompletionCallback> |
626 PendingSmoothScrollGestureMap; | 634 PendingSmoothScrollGestureMap; |
627 PendingSmoothScrollGestureMap pending_smooth_scroll_gestures_; | 635 PendingSmoothScrollGestureMap pending_smooth_scroll_gestures_; |
628 | 636 |
629 // Specified whether the compositor will run in its own thread. | 637 // Specified whether the compositor will run in its own thread. |
630 bool is_threaded_compositing_enabled_; | 638 bool is_threaded_compositing_enabled_; |
631 | 639 |
| 640 // Captures information about what input events and frames are currently |
| 641 // being processed. |
| 642 bool started_frame_; |
| 643 bool got_input_; |
| 644 |
| 645 cc::LatencyInfo latency_info_; |
| 646 |
632 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 647 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
633 }; | 648 }; |
634 | 649 |
635 } // namespace content | 650 } // namespace content |
636 | 651 |
637 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 652 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |