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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 #endif | 64 #endif |
65 | 65 |
66 namespace content { | 66 namespace content { |
67 class BackingStore; | 67 class BackingStore; |
68 class GestureEventFilter; | 68 class GestureEventFilter; |
69 class MockRenderWidgetHost; | 69 class MockRenderWidgetHost; |
70 class OverscrollController; | 70 class OverscrollController; |
71 class RenderWidgetHostDelegate; | 71 class RenderWidgetHostDelegate; |
72 class RenderWidgetHostViewPort; | 72 class RenderWidgetHostViewPort; |
73 class SmoothScrollGesture; | 73 class SmoothScrollGestureController; |
74 class TouchEventQueue; | 74 class TouchEventQueue; |
75 struct EditCommand; | 75 struct EditCommand; |
76 | 76 |
77 // This implements the RenderWidgetHost interface that is exposed to | 77 // This implements the RenderWidgetHost interface that is exposed to |
78 // embedders of content, and adds things only visible to content. | 78 // embedders of content, and adds things only visible to content. |
79 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, | 79 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
80 public IPC::Listener { | 80 public IPC::Listener { |
81 public: | 81 public: |
82 // routing_id can be MSG_ROUTING_NONE, in which case the next available | 82 // routing_id can be MSG_ROUTING_NONE, in which case the next available |
83 // routing id is taken from the RenderProcessHost. | 83 // routing id is taken from the RenderProcessHost. |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 uint64 surface_handle, | 575 uint64 surface_handle, |
576 int32 route_id, | 576 int32 route_id, |
577 const gfx::Size& size, | 577 const gfx::Size& size, |
578 int32 gpu_process_host_id); | 578 int32 gpu_process_host_id); |
579 bool OnSwapCompositorFrame(const IPC::Message& message); | 579 bool OnSwapCompositorFrame(const IPC::Message& message); |
580 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 580 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
581 void OnUpdateIsDelayed(); | 581 void OnUpdateIsDelayed(); |
582 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, | 582 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, |
583 InputEventAckState ack_result); | 583 InputEventAckState ack_result); |
584 void OnBeginSmoothScroll( | 584 void OnBeginSmoothScroll( |
585 int gesture_id, | 585 const ViewHostMsg_BeginSmoothScroll_Params& params, |
586 const ViewHostMsg_BeginSmoothScroll_Params ¶ms); | 586 bool* smooth_scroll_started); |
587 void OnSelectRangeAck(); | 587 void OnSelectRangeAck(); |
588 void OnMsgMoveCaretAck(); | 588 void OnMsgMoveCaretAck(); |
589 virtual void OnFocus(); | 589 virtual void OnFocus(); |
590 virtual void OnBlur(); | 590 virtual void OnBlur(); |
591 void OnHasTouchEventHandlers(bool has_handlers); | 591 void OnHasTouchEventHandlers(bool has_handlers); |
592 void OnSetCursor(const WebCursor& cursor); | 592 void OnSetCursor(const WebCursor& cursor); |
593 void OnTextInputStateChanged( | 593 void OnTextInputStateChanged( |
594 const ViewHostMsg_TextInputState_Params& params); | 594 const ViewHostMsg_TextInputState_Params& params); |
595 void OnImeCompositionRangeChanged( | 595 void OnImeCompositionRangeChanged( |
596 const ui::Range& range, | 596 const ui::Range& range, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 | 657 |
658 // Called on OnInputEventAck() to process a touch event ack message. | 658 // Called on OnInputEventAck() to process a touch event ack message. |
659 // This can result in a gesture event being generated and sent back to the | 659 // This can result in a gesture event being generated and sent back to the |
660 // renderer. | 660 // renderer. |
661 void ProcessTouchAck(InputEventAckState ack_result); | 661 void ProcessTouchAck(InputEventAckState ack_result); |
662 | 662 |
663 // Called when there is a new auto resize (using a post to avoid a stack | 663 // Called when there is a new auto resize (using a post to avoid a stack |
664 // which may get in recursive loops). | 664 // which may get in recursive loops). |
665 void DelayedAutoResized(); | 665 void DelayedAutoResized(); |
666 | 666 |
667 // Called periodically to advance the active scroll gesture after being | |
668 // initiated by OnBeginSmoothScroll. | |
669 void TickActiveSmoothScrollGesture(); | |
670 | 667 |
671 // Our delegate, which wants to know mainly about keyboard events. | 668 // Our delegate, which wants to know mainly about keyboard events. |
672 // It will remain non-NULL until DetachDelegate() is called. | 669 // It will remain non-NULL until DetachDelegate() is called. |
673 RenderWidgetHostDelegate* delegate_; | 670 RenderWidgetHostDelegate* delegate_; |
674 | 671 |
675 // Created during construction but initialized during Init*(). Therefore, it | 672 // Created during construction but initialized during Init*(). Therefore, it |
676 // is guaranteed never to be NULL, but its channel may be NULL if the | 673 // is guaranteed never to be NULL, but its channel may be NULL if the |
677 // renderer crashed, so you must always check that. | 674 // renderer crashed, so you must always check that. |
678 RenderProcessHost* process_; | 675 RenderProcessHost* process_; |
679 | 676 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 bool pending_mouse_lock_request_; | 850 bool pending_mouse_lock_request_; |
854 bool allow_privileged_mouse_lock_; | 851 bool allow_privileged_mouse_lock_; |
855 | 852 |
856 // Keeps track of whether the webpage has any touch event handler. If it does, | 853 // Keeps track of whether the webpage has any touch event handler. If it does, |
857 // then touch events are sent to the renderer. Otherwise, the touch events are | 854 // then touch events are sent to the renderer. Otherwise, the touch events are |
858 // not sent to the renderer. | 855 // not sent to the renderer. |
859 bool has_touch_handler_; | 856 bool has_touch_handler_; |
860 | 857 |
861 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 858 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
862 | 859 |
863 typedef std::map<int, scoped_refptr<SmoothScrollGesture> > | 860 scoped_ptr<SmoothScrollGestureController> smooth_scroll_gesture_controller_; |
864 SmoothScrollGestureMap; | |
865 SmoothScrollGestureMap active_smooth_scroll_gestures_; | |
866 base::TimeTicks last_smooth_scroll_gestures_tick_time_; | |
867 bool tick_active_smooth_scroll_gestures_task_posted_; | |
868 | |
869 scoped_ptr<TouchEventQueue> touch_event_queue_; | 861 scoped_ptr<TouchEventQueue> touch_event_queue_; |
870 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 862 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
871 scoped_ptr<OverscrollController> overscroll_controller_; | 863 scoped_ptr<OverscrollController> overscroll_controller_; |
872 | 864 |
873 #if defined(OS_WIN) | 865 #if defined(OS_WIN) |
874 std::list<HWND> dummy_windows_for_activation_; | 866 std::list<HWND> dummy_windows_for_activation_; |
875 #endif | 867 #endif |
876 | 868 |
877 // List of callbacks for pending snapshot requests to the renderer. | 869 // List of callbacks for pending snapshot requests to the renderer. |
878 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; | 870 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; |
879 | 871 |
880 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 872 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
881 }; | 873 }; |
882 | 874 |
883 } // namespace content | 875 } // namespace content |
884 | 876 |
885 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 877 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |