| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 uint64 surface_handle, | 558 uint64 surface_handle, |
| 559 int32 route_id, | 559 int32 route_id, |
| 560 const gfx::Size& size, | 560 const gfx::Size& size, |
| 561 int32 gpu_process_host_id); | 561 int32 gpu_process_host_id); |
| 562 void OnSwapCompositorFrame(const cc::CompositorFrame& frame); | 562 void OnSwapCompositorFrame(const cc::CompositorFrame& frame); |
| 563 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 563 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
| 564 void OnUpdateIsDelayed(); | 564 void OnUpdateIsDelayed(); |
| 565 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, | 565 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, |
| 566 InputEventAckState ack_result); | 566 InputEventAckState ack_result); |
| 567 void OnBeginSmoothScroll( | 567 void OnBeginSmoothScroll( |
| 568 int gesture_id, | 568 const ViewHostMsg_BeginSmoothScroll_Params& params, |
| 569 const ViewHostMsg_BeginSmoothScroll_Params ¶ms); | 569 bool* smooth_scroll_started); |
| 570 void OnSelectRangeAck(); | 570 void OnSelectRangeAck(); |
| 571 void OnMsgMoveCaretAck(); | 571 void OnMsgMoveCaretAck(); |
| 572 virtual void OnFocus(); | 572 virtual void OnFocus(); |
| 573 virtual void OnBlur(); | 573 virtual void OnBlur(); |
| 574 void OnHasTouchEventHandlers(bool has_handlers); | 574 void OnHasTouchEventHandlers(bool has_handlers); |
| 575 void OnSetCursor(const WebCursor& cursor); | 575 void OnSetCursor(const WebCursor& cursor); |
| 576 void OnTextInputStateChanged( | 576 void OnTextInputStateChanged( |
| 577 const ViewHostMsg_TextInputState_Params& params); | 577 const ViewHostMsg_TextInputState_Params& params); |
| 578 void OnImeCompositionRangeChanged( | 578 void OnImeCompositionRangeChanged( |
| 579 const ui::Range& range, | 579 const ui::Range& range, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 | 669 |
| 670 // Called on OnInputEventAck() to process a touch event ack message. | 670 // Called on OnInputEventAck() to process a touch event ack message. |
| 671 // This can result in a gesture event being generated and sent back to the | 671 // This can result in a gesture event being generated and sent back to the |
| 672 // renderer. | 672 // renderer. |
| 673 void ProcessTouchAck(InputEventAckState ack_result); | 673 void ProcessTouchAck(InputEventAckState ack_result); |
| 674 | 674 |
| 675 // Called when there is a new auto resize (using a post to avoid a stack | 675 // Called when there is a new auto resize (using a post to avoid a stack |
| 676 // which may get in recursive loops). | 676 // which may get in recursive loops). |
| 677 void DelayedAutoResized(); | 677 void DelayedAutoResized(); |
| 678 | 678 |
| 679 // Called periodically to advance the active scroll gesture after being | |
| 680 // initiated by OnBeginSmoothScroll. | |
| 681 void TickActiveSmoothScrollGesture(); | |
| 682 | 679 |
| 683 // Our delegate, which wants to know mainly about keyboard events. | 680 // Our delegate, which wants to know mainly about keyboard events. |
| 684 // It will remain non-NULL until DetachDelegate() is called. | 681 // It will remain non-NULL until DetachDelegate() is called. |
| 685 RenderWidgetHostDelegate* delegate_; | 682 RenderWidgetHostDelegate* delegate_; |
| 686 | 683 |
| 687 // Created during construction but initialized during Init*(). Therefore, it | 684 // Created during construction but initialized during Init*(). Therefore, it |
| 688 // is guaranteed never to be NULL, but its channel may be NULL if the | 685 // is guaranteed never to be NULL, but its channel may be NULL if the |
| 689 // renderer crashed, so you must always check that. | 686 // renderer crashed, so you must always check that. |
| 690 RenderProcessHost* process_; | 687 RenderProcessHost* process_; |
| 691 | 688 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 bool pending_mouse_lock_request_; | 855 bool pending_mouse_lock_request_; |
| 859 bool allow_privileged_mouse_lock_; | 856 bool allow_privileged_mouse_lock_; |
| 860 | 857 |
| 861 // Keeps track of whether the webpage has any touch event handler. If it does, | 858 // Keeps track of whether the webpage has any touch event handler. If it does, |
| 862 // then touch events are sent to the renderer. Otherwise, the touch events are | 859 // then touch events are sent to the renderer. Otherwise, the touch events are |
| 863 // not sent to the renderer. | 860 // not sent to the renderer. |
| 864 bool has_touch_handler_; | 861 bool has_touch_handler_; |
| 865 | 862 |
| 866 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 863 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 867 | 864 |
| 868 typedef std::map<int, scoped_refptr<SmoothScrollGesture> > | 865 scoped_ptr<SmoothScrollGestureController> smooth_scroll_gesture_controller_; |
| 869 SmoothScrollGestureMap; | |
| 870 SmoothScrollGestureMap active_smooth_scroll_gestures_; | |
| 871 base::TimeTicks last_smooth_scroll_gestures_tick_time_; | |
| 872 bool tick_active_smooth_scroll_gestures_task_posted_; | |
| 873 | |
| 874 scoped_ptr<TouchEventQueue> touch_event_queue_; | 866 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 875 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 867 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 876 scoped_ptr<OverscrollController> overscroll_controller_; | 868 scoped_ptr<OverscrollController> overscroll_controller_; |
| 877 | 869 |
| 878 // This keeps track of the ACKs received for touch events from the renderer. | 870 // This keeps track of the ACKs received for touch events from the renderer. |
| 879 // If the ack for any event is NO_CONSUMER_EXISTS, then no subsequent touch | 871 // If the ack for any event is NO_CONSUMER_EXISTS, then no subsequent touch |
| 880 // events should reach the renderer until all the fingers have been lifted | 872 // events should reach the renderer until all the fingers have been lifted |
| 881 InputEventAckState touch_event_state_; | 873 InputEventAckState touch_event_state_; |
| 882 | 874 |
| 883 #if defined(OS_WIN) | 875 #if defined(OS_WIN) |
| 884 std::list<HWND> dummy_windows_for_activation_; | 876 std::list<HWND> dummy_windows_for_activation_; |
| 885 #endif | 877 #endif |
| 886 | 878 |
| 887 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 879 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 888 }; | 880 }; |
| 889 | 881 |
| 890 } // namespace content | 882 } // namespace content |
| 891 | 883 |
| 892 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 884 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |