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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 namespace content { | 78 namespace content { |
79 class BackingStore; | 79 class BackingStore; |
80 class InputRouter; | 80 class InputRouter; |
81 class MockRenderWidgetHost; | 81 class MockRenderWidgetHost; |
82 class OverscrollController; | 82 class OverscrollController; |
83 class RenderWidgetHostDelegate; | 83 class RenderWidgetHostDelegate; |
84 class RenderWidgetHostViewPort; | 84 class RenderWidgetHostViewPort; |
85 class SyntheticGestureController; | 85 class SyntheticGestureController; |
86 class TimeoutMonitor; | 86 class TimeoutMonitor; |
| 87 class TouchEmulator; |
87 class WebCursor; | 88 class WebCursor; |
88 struct EditCommand; | 89 struct EditCommand; |
89 | 90 |
90 // This implements the RenderWidgetHost interface that is exposed to | 91 // This implements the RenderWidgetHost interface that is exposed to |
91 // embedders of content, and adds things only visible to content. | 92 // embedders of content, and adds things only visible to content. |
92 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, | 93 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
93 public InputRouterClient, | 94 public InputRouterClient, |
94 public InputAckHandler, | 95 public InputAckHandler, |
95 public IPC::Listener { | 96 public IPC::Listener { |
96 public: | 97 public: |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 void ForwardWheelEventWithLatencyInfo( | 303 void ForwardWheelEventWithLatencyInfo( |
303 const blink::WebMouseWheelEvent& wheel_event, | 304 const blink::WebMouseWheelEvent& wheel_event, |
304 const ui::LatencyInfo& ui_latency); | 305 const ui::LatencyInfo& ui_latency); |
305 | 306 |
306 // Queues a synthetic gesture for testing purposes. Invokes the on_complete | 307 // Queues a synthetic gesture for testing purposes. Invokes the on_complete |
307 // callback when the gesture is finished running. | 308 // callback when the gesture is finished running. |
308 void QueueSyntheticGesture( | 309 void QueueSyntheticGesture( |
309 scoped_ptr<SyntheticGesture> synthetic_gesture, | 310 scoped_ptr<SyntheticGesture> synthetic_gesture, |
310 const base::Callback<void(SyntheticGesture::Result)>& on_complete); | 311 const base::Callback<void(SyntheticGesture::Result)>& on_complete); |
311 | 312 |
| 313 // Sets cursor to the view. |
| 314 void SetCursor(const WebCursor& cursor); |
| 315 |
312 void CancelUpdateTextDirection(); | 316 void CancelUpdateTextDirection(); |
313 | 317 |
314 // Called when a mouse click/gesture tap activates the renderer. | 318 // Called when a mouse click/gesture tap activates the renderer. |
315 virtual void OnPointerEventActivate(); | 319 virtual void OnPointerEventActivate(); |
316 | 320 |
317 // Notifies the renderer whether or not the input method attached to this | 321 // Notifies the renderer whether or not the input method attached to this |
318 // process is activated. | 322 // process is activated. |
319 // When the input method is activated, a renderer process sends IPC messages | 323 // When the input method is activated, a renderer process sends IPC messages |
320 // to notify the status of its composition node. (This message is mainly used | 324 // to notify the status of its composition node. (This message is mainly used |
321 // for notifying the position of the input cursor so that the browser can | 325 // for notifying the position of the input cursor so that the browser can |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 bool OnSwapCompositorFrame(const IPC::Message& message); | 680 bool OnSwapCompositorFrame(const IPC::Message& message); |
677 void OnOverscrolled(gfx::Vector2dF accumulated_overscroll, | 681 void OnOverscrolled(gfx::Vector2dF accumulated_overscroll, |
678 gfx::Vector2dF current_fling_velocity); | 682 gfx::Vector2dF current_fling_velocity); |
679 void OnFlingingStopped(); | 683 void OnFlingingStopped(); |
680 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 684 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
681 void OnUpdateIsDelayed(); | 685 void OnUpdateIsDelayed(); |
682 void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet); | 686 void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet); |
683 virtual void OnFocus(); | 687 virtual void OnFocus(); |
684 virtual void OnBlur(); | 688 virtual void OnBlur(); |
685 void OnSetCursor(const WebCursor& cursor); | 689 void OnSetCursor(const WebCursor& cursor); |
| 690 void OnSetTouchEventEmulationEnabled(bool enabled); |
686 void OnTextInputTypeChanged(ui::TextInputType type, | 691 void OnTextInputTypeChanged(ui::TextInputType type, |
687 ui::TextInputMode input_mode, | 692 ui::TextInputMode input_mode, |
688 bool can_compose_inline); | 693 bool can_compose_inline); |
689 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) | 694 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) |
690 void OnImeCompositionRangeChanged( | 695 void OnImeCompositionRangeChanged( |
691 const gfx::Range& range, | 696 const gfx::Range& range, |
692 const std::vector<gfx::Rect>& character_bounds); | 697 const std::vector<gfx::Rect>& character_bounds); |
693 #endif | 698 #endif |
694 void OnImeCancelComposition(); | 699 void OnImeCancelComposition(); |
695 void OnDidActivateAcceleratedCompositing(bool activated); | 700 void OnDidActivateAcceleratedCompositing(bool activated); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 | 929 |
925 // Keeps track of whether the webpage has any touch event handler. If it does, | 930 // Keeps track of whether the webpage has any touch event handler. If it does, |
926 // then touch events are sent to the renderer. Otherwise, the touch events are | 931 // then touch events are sent to the renderer. Otherwise, the touch events are |
927 // not sent to the renderer. | 932 // not sent to the renderer. |
928 bool has_touch_handler_; | 933 bool has_touch_handler_; |
929 | 934 |
930 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 935 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
931 | 936 |
932 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; | 937 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; |
933 | 938 |
| 939 scoped_ptr<TouchEmulator> touch_emulator_; |
| 940 |
934 // Receives and handles all input events. | 941 // Receives and handles all input events. |
935 scoped_ptr<InputRouter> input_router_; | 942 scoped_ptr<InputRouter> input_router_; |
936 | 943 |
937 scoped_ptr<OverscrollController> overscroll_controller_; | 944 scoped_ptr<OverscrollController> overscroll_controller_; |
938 | 945 |
939 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; | 946 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; |
940 | 947 |
941 #if defined(OS_WIN) | 948 #if defined(OS_WIN) |
942 std::list<HWND> dummy_windows_for_activation_; | 949 std::list<HWND> dummy_windows_for_activation_; |
943 #endif | 950 #endif |
944 | 951 |
945 // List of callbacks for pending snapshot requests to the renderer. | 952 // List of callbacks for pending snapshot requests to the renderer. |
946 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; | 953 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; |
947 | 954 |
948 int64 last_input_number_; | 955 int64 last_input_number_; |
949 | 956 |
950 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 957 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
951 }; | 958 }; |
952 | 959 |
953 } // namespace content | 960 } // namespace content |
954 | 961 |
955 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 962 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |