Chromium Code Reviews| 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 } | 61 } |
| 62 #endif | 62 #endif |
| 63 | 63 |
| 64 namespace content { | 64 namespace content { |
| 65 class BackingStore; | 65 class BackingStore; |
| 66 class GestureEventFilter; | 66 class GestureEventFilter; |
| 67 class MockRenderWidgetHost; | 67 class MockRenderWidgetHost; |
| 68 class OverscrollController; | 68 class OverscrollController; |
| 69 class RenderWidgetHostDelegate; | 69 class RenderWidgetHostDelegate; |
| 70 class RenderWidgetHostViewPort; | 70 class RenderWidgetHostViewPort; |
| 71 class SmoothScrollGesture; | 71 class SmoothScrollGestureController; |
| 72 class TouchEventQueue; | 72 class TouchEventQueue; |
| 73 struct EditCommand; | 73 struct EditCommand; |
| 74 | 74 |
| 75 // This implements the RenderWidgetHost interface that is exposed to | 75 // This implements the RenderWidgetHost interface that is exposed to |
| 76 // embedders of content, and adds things only visible to content. | 76 // embedders of content, and adds things only visible to content. |
| 77 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, | 77 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| 78 public IPC::Listener { | 78 public IPC::Listener { |
| 79 public: | 79 public: |
| 80 // routing_id can be MSG_ROUTING_NONE, in which case the next available | 80 // routing_id can be MSG_ROUTING_NONE, in which case the next available |
| 81 // routing id is taken from the RenderProcessHost. | 81 // routing id is taken from the RenderProcessHost. |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 555 int32 route_id, | 555 int32 route_id, |
| 556 const gfx::Size& size, | 556 const gfx::Size& size, |
| 557 int32 gpu_process_host_id); | 557 int32 gpu_process_host_id); |
| 558 void OnSwapCompositorFrame(const cc::CompositorFrame& frame); | 558 void OnSwapCompositorFrame(const cc::CompositorFrame& frame); |
| 559 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 559 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
| 560 void OnUpdateIsDelayed(); | 560 void OnUpdateIsDelayed(); |
| 561 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, | 561 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, |
| 562 InputEventAckState ack_result); | 562 InputEventAckState ack_result); |
| 563 void OnBeginSmoothScroll( | 563 void OnBeginSmoothScroll( |
| 564 int gesture_id, | 564 int gesture_id, |
| 565 const ViewHostMsg_BeginSmoothScroll_Params ¶ms); | 565 const ViewHostMsg_BeginSmoothScroll_Params& params); |
| 566 void OnSelectRangeAck(); | 566 void OnSelectRangeAck(); |
| 567 void OnMsgMoveCaretAck(); | 567 void OnMsgMoveCaretAck(); |
| 568 virtual void OnFocus(); | 568 virtual void OnFocus(); |
| 569 virtual void OnBlur(); | 569 virtual void OnBlur(); |
| 570 void OnHasTouchEventHandlers(bool has_handlers); | 570 void OnHasTouchEventHandlers(bool has_handlers); |
| 571 void OnSetCursor(const WebCursor& cursor); | 571 void OnSetCursor(const WebCursor& cursor); |
| 572 void OnTextInputStateChanged( | 572 void OnTextInputStateChanged( |
| 573 const ViewHostMsg_TextInputState_Params& params); | 573 const ViewHostMsg_TextInputState_Params& params); |
| 574 void OnImeCompositionRangeChanged( | 574 void OnImeCompositionRangeChanged( |
| 575 const ui::Range& range, | 575 const ui::Range& range, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 665 | 665 |
| 666 // Called on OnInputEventAck() to process a touch event ack message. | 666 // Called on OnInputEventAck() to process a touch event ack message. |
| 667 // This can result in a gesture event being generated and sent back to the | 667 // This can result in a gesture event being generated and sent back to the |
| 668 // renderer. | 668 // renderer. |
| 669 void ProcessTouchAck(InputEventAckState ack_result); | 669 void ProcessTouchAck(InputEventAckState ack_result); |
| 670 | 670 |
| 671 // Called when there is a new auto resize (using a post to avoid a stack | 671 // Called when there is a new auto resize (using a post to avoid a stack |
| 672 // which may get in recursive loops). | 672 // which may get in recursive loops). |
| 673 void DelayedAutoResized(); | 673 void DelayedAutoResized(); |
| 674 | 674 |
| 675 // Called periodically to advance the active scroll gesture after being | |
| 676 // initiated by OnBeginSmoothScroll. | |
| 677 void TickActiveSmoothScrollGesture(); | |
| 678 | 675 |
| 679 // Our delegate, which wants to know mainly about keyboard events. | 676 // Our delegate, which wants to know mainly about keyboard events. |
| 680 // It will remain non-NULL until DetachDelegate() is called. | 677 // It will remain non-NULL until DetachDelegate() is called. |
| 681 RenderWidgetHostDelegate* delegate_; | 678 RenderWidgetHostDelegate* delegate_; |
| 682 | 679 |
| 683 // Created during construction but initialized during Init*(). Therefore, it | 680 // Created during construction but initialized during Init*(). Therefore, it |
| 684 // is guaranteed never to be NULL, but its channel may be NULL if the | 681 // is guaranteed never to be NULL, but its channel may be NULL if the |
| 685 // renderer crashed, so you must always check that. | 682 // renderer crashed, so you must always check that. |
| 686 RenderProcessHost* process_; | 683 RenderProcessHost* process_; |
| 687 | 684 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 854 bool pending_mouse_lock_request_; | 851 bool pending_mouse_lock_request_; |
| 855 bool allow_privileged_mouse_lock_; | 852 bool allow_privileged_mouse_lock_; |
| 856 | 853 |
| 857 // Keeps track of whether the webpage has any touch event handler. If it does, | 854 // Keeps track of whether the webpage has any touch event handler. If it does, |
| 858 // then touch events are sent to the renderer. Otherwise, the touch events are | 855 // then touch events are sent to the renderer. Otherwise, the touch events are |
| 859 // not sent to the renderer. | 856 // not sent to the renderer. |
| 860 bool has_touch_handler_; | 857 bool has_touch_handler_; |
| 861 | 858 |
| 862 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 859 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 863 | 860 |
| 864 typedef std::map<int, scoped_refptr<SmoothScrollGesture> > | 861 scoped_ptr<SmoothScrollGestureController> smooth_scroll_gesture_controller_; |
|
rjkroege
2013/02/11 22:47:27
The SmoothScrollGestureController is a lot like an
| |
| 865 SmoothScrollGestureMap; | |
| 866 SmoothScrollGestureMap active_smooth_scroll_gestures_; | |
| 867 base::TimeTicks last_smooth_scroll_gestures_tick_time_; | |
| 868 bool tick_active_smooth_scroll_gestures_task_posted_; | |
| 869 | |
| 870 scoped_ptr<TouchEventQueue> touch_event_queue_; | 862 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 871 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 863 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 872 scoped_ptr<OverscrollController> overscroll_controller_; | 864 scoped_ptr<OverscrollController> overscroll_controller_; |
| 873 | 865 |
| 874 #if defined(OS_WIN) | 866 #if defined(OS_WIN) |
| 875 std::list<HWND> dummy_windows_for_activation_; | 867 std::list<HWND> dummy_windows_for_activation_; |
| 876 #endif | 868 #endif |
| 877 | 869 |
| 878 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 870 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 879 }; | 871 }; |
| 880 | 872 |
| 881 } // namespace content | 873 } // namespace content |
| 882 | 874 |
| 883 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 875 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |