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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 uint64 surface_handle, | 554 uint64 surface_handle, |
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 const ViewHostMsg_BeginSmoothScroll_Params& params, |
565 const ViewHostMsg_BeginSmoothScroll_Params ¶ms); | 565 bool* smooth_scroll_started); |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 | 635 |
636 // Called on OnInputEventAck() to process a touch event ack message. | 636 // Called on OnInputEventAck() to process a touch event ack message. |
637 // This can result in a gesture event being generated and sent back to the | 637 // This can result in a gesture event being generated and sent back to the |
638 // renderer. | 638 // renderer. |
639 void ProcessTouchAck(InputEventAckState ack_result); | 639 void ProcessTouchAck(InputEventAckState ack_result); |
640 | 640 |
641 // Called when there is a new auto resize (using a post to avoid a stack | 641 // Called when there is a new auto resize (using a post to avoid a stack |
642 // which may get in recursive loops). | 642 // which may get in recursive loops). |
643 void DelayedAutoResized(); | 643 void DelayedAutoResized(); |
644 | 644 |
645 // Called periodically to advance the active scroll gesture after being | |
646 // initiated by OnBeginSmoothScroll. | |
647 void TickActiveSmoothScrollGesture(); | |
648 | 645 |
649 // Our delegate, which wants to know mainly about keyboard events. | 646 // Our delegate, which wants to know mainly about keyboard events. |
650 // It will remain non-NULL until DetachDelegate() is called. | 647 // It will remain non-NULL until DetachDelegate() is called. |
651 RenderWidgetHostDelegate* delegate_; | 648 RenderWidgetHostDelegate* delegate_; |
652 | 649 |
653 // Created during construction but initialized during Init*(). Therefore, it | 650 // Created during construction but initialized during Init*(). Therefore, it |
654 // is guaranteed never to be NULL, but its channel may be NULL if the | 651 // is guaranteed never to be NULL, but its channel may be NULL if the |
655 // renderer crashed, so you must always check that. | 652 // renderer crashed, so you must always check that. |
656 RenderProcessHost* process_; | 653 RenderProcessHost* process_; |
657 | 654 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 bool pending_mouse_lock_request_; | 819 bool pending_mouse_lock_request_; |
823 bool allow_privileged_mouse_lock_; | 820 bool allow_privileged_mouse_lock_; |
824 | 821 |
825 // Keeps track of whether the webpage has any touch event handler. If it does, | 822 // Keeps track of whether the webpage has any touch event handler. If it does, |
826 // then touch events are sent to the renderer. Otherwise, the touch events are | 823 // then touch events are sent to the renderer. Otherwise, the touch events are |
827 // not sent to the renderer. | 824 // not sent to the renderer. |
828 bool has_touch_handler_; | 825 bool has_touch_handler_; |
829 | 826 |
830 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 827 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
831 | 828 |
832 typedef std::map<int, scoped_refptr<SmoothScrollGesture> > | 829 scoped_ptr<SmoothScrollGestureController> smooth_scroll_gesture_controller_; |
833 SmoothScrollGestureMap; | |
834 SmoothScrollGestureMap active_smooth_scroll_gestures_; | |
835 base::TimeTicks last_smooth_scroll_gestures_tick_time_; | |
836 bool tick_active_smooth_scroll_gestures_task_posted_; | |
837 | |
838 scoped_ptr<TouchEventQueue> touch_event_queue_; | 830 scoped_ptr<TouchEventQueue> touch_event_queue_; |
839 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 831 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
840 scoped_ptr<OverscrollController> overscroll_controller_; | 832 scoped_ptr<OverscrollController> overscroll_controller_; |
841 | 833 |
842 #if defined(OS_WIN) | 834 #if defined(OS_WIN) |
843 std::list<HWND> dummy_windows_for_activation_; | 835 std::list<HWND> dummy_windows_for_activation_; |
844 #endif | 836 #endif |
845 | 837 |
846 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 838 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
847 }; | 839 }; |
848 | 840 |
849 } // namespace content | 841 } // namespace content |
850 | 842 |
851 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 843 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |