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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 #include "base/strings/string16.h" | 23 #include "base/strings/string16.h" |
| 24 #include "base/time/time.h" | 24 #include "base/time/time.h" |
| 25 #include "base/timer/elapsed_timer.h" | 25 #include "base/timer/elapsed_timer.h" |
| 26 #include "build/build_config.h" | 26 #include "build/build_config.h" |
| 27 #include "cc/resources/shared_bitmap.h" | 27 #include "cc/resources/shared_bitmap.h" |
| 28 #include "content/browser/renderer_host/event_with_latency_info.h" | 28 #include "content/browser/renderer_host/event_with_latency_info.h" |
| 29 #include "content/browser/renderer_host/input/input_ack_handler.h" | 29 #include "content/browser/renderer_host/input/input_ack_handler.h" |
| 30 #include "content/browser/renderer_host/input/input_router_client.h" | 30 #include "content/browser/renderer_host/input/input_router_client.h" |
| 31 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker .h" | 31 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker .h" |
| 32 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 32 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 33 #include "content/browser/renderer_host/input/synthetic_pointer_action.h" | |
| 33 #include "content/browser/renderer_host/input/touch_emulator_client.h" | 34 #include "content/browser/renderer_host/input/touch_emulator_client.h" |
| 34 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 35 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 35 #include "content/common/input/input_event_ack_state.h" | 36 #include "content/common/input/input_event_ack_state.h" |
| 36 #include "content/common/input/synthetic_gesture_packet.h" | 37 #include "content/common/input/synthetic_gesture_packet.h" |
| 37 #include "content/common/view_message_enums.h" | 38 #include "content/common/view_message_enums.h" |
| 38 #include "content/public/browser/readback_types.h" | 39 #include "content/public/browser/readback_types.h" |
| 39 #include "content/public/browser/render_widget_host.h" | 40 #include "content/public/browser/render_widget_host.h" |
| 40 #include "content/public/common/page_zoom.h" | 41 #include "content/public/common/page_zoom.h" |
| 41 #include "ipc/ipc_listener.h" | 42 #include "ipc/ipc_listener.h" |
| 42 #include "third_party/WebKit/public/platform/WebDisplayMode.h" | 43 #include "third_party/WebKit/public/platform/WebDisplayMode.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 class MockRenderWidgetHost; | 81 class MockRenderWidgetHost; |
| 81 class RenderWidgetHostDelegate; | 82 class RenderWidgetHostDelegate; |
| 82 class RenderWidgetHostOwnerDelegate; | 83 class RenderWidgetHostOwnerDelegate; |
| 83 class SyntheticGestureController; | 84 class SyntheticGestureController; |
| 84 class TimeoutMonitor; | 85 class TimeoutMonitor; |
| 85 class TouchEmulator; | 86 class TouchEmulator; |
| 86 class WebCursor; | 87 class WebCursor; |
| 87 struct EditCommand; | 88 struct EditCommand; |
| 88 struct ResizeParams; | 89 struct ResizeParams; |
| 89 | 90 |
| 91 using blink::WebTouchEvent; | |
| 92 | |
| 90 // This implements the RenderWidgetHost interface that is exposed to | 93 // This implements the RenderWidgetHost interface that is exposed to |
| 91 // embedders of content, and adds things only visible to content. | 94 // embedders of content, and adds things only visible to content. |
| 92 class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost, | 95 class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost, |
| 93 public InputRouterClient, | 96 public InputRouterClient, |
| 94 public InputAckHandler, | 97 public InputAckHandler, |
| 95 public TouchEmulatorClient, | 98 public TouchEmulatorClient, |
| 96 public IPC::Listener { | 99 public IPC::Listener { |
| 97 public: | 100 public: |
| 98 // |routing_id| must not be MSG_ROUTING_NONE. | 101 // |routing_id| must not be MSG_ROUTING_NONE. |
| 99 // If this object outlives |delegate|, DetachDelegate() must be called when | 102 // If this object outlives |delegate|, DetachDelegate() must be called when |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 // Called (either immediately or asynchronously) after we're done with our | 598 // Called (either immediately or asynchronously) after we're done with our |
| 596 // BackingStore and can send an ACK to the renderer so it can paint onto it | 599 // BackingStore and can send an ACK to the renderer so it can paint onto it |
| 597 // again. | 600 // again. |
| 598 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, | 601 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, |
| 599 const base::TimeTicks& paint_start); | 602 const base::TimeTicks& paint_start); |
| 600 | 603 |
| 601 // Give key press listeners a chance to handle this key press. This allow | 604 // Give key press listeners a chance to handle this key press. This allow |
| 602 // widgets that don't have focus to still handle key presses. | 605 // widgets that don't have focus to still handle key presses. |
| 603 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); | 606 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); |
| 604 | 607 |
| 608 void QueueSyntheticPointerAction( | |
| 609 const SyntheticPointerActionParams& gesture_params); | |
| 610 | |
| 611 void SetSyntheticPointer(const SyntheticPointerActionParams& gesture_params); | |
| 612 | |
| 605 // InputRouterClient | 613 // InputRouterClient |
| 606 InputEventAckState FilterInputEvent( | 614 InputEventAckState FilterInputEvent( |
| 607 const blink::WebInputEvent& event, | 615 const blink::WebInputEvent& event, |
| 608 const ui::LatencyInfo& latency_info) override; | 616 const ui::LatencyInfo& latency_info) override; |
| 609 void IncrementInFlightEventCount() override; | 617 void IncrementInFlightEventCount() override; |
| 610 void DecrementInFlightEventCount() override; | 618 void DecrementInFlightEventCount() override; |
| 611 void OnHasTouchEventHandlers(bool has_handlers) override; | 619 void OnHasTouchEventHandlers(bool has_handlers) override; |
| 612 void DidFlush() override; | 620 void DidFlush() override; |
| 613 void DidOverscroll(const DidOverscrollParams& params) override; | 621 void DidOverscroll(const DidOverscrollParams& params) override; |
| 614 void DidStopFlinging() override; | 622 void DidStopFlinging() override; |
| 615 | 623 |
| 616 // InputAckHandler | 624 // InputAckHandler |
| 617 void OnKeyboardEventAck(const NativeWebKeyboardEventWithLatencyInfo& event, | 625 void OnKeyboardEventAck(const NativeWebKeyboardEventWithLatencyInfo& event, |
| 618 InputEventAckState ack_result) override; | 626 InputEventAckState ack_result) override; |
| 619 void OnMouseEventAck(const MouseEventWithLatencyInfo& event, | 627 void OnMouseEventAck(const MouseEventWithLatencyInfo& event, |
| 620 InputEventAckState ack_result) override; | 628 InputEventAckState ack_result) override; |
| 621 void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, | 629 void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, |
| 622 InputEventAckState ack_result) override; | 630 InputEventAckState ack_result) override; |
| 623 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 631 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
| 624 InputEventAckState ack_result) override; | 632 InputEventAckState ack_result) override; |
| 625 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, | 633 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, |
| 626 InputEventAckState ack_result) override; | 634 InputEventAckState ack_result) override; |
| 627 void OnUnexpectedEventAck(UnexpectedEventAckType type) override; | 635 void OnUnexpectedEventAck(UnexpectedEventAckType type) override; |
| 628 | 636 |
| 629 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); | 637 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); |
| 630 | 638 |
| 639 void OnSyntheticPointerActionCompleted(SyntheticGesture::Result result); | |
|
tdresser
2016/04/18 15:24:39
It isn't clear to me why we need this in addition
lanwei
2016/04/19 19:05:32
Yes, but OnSyntheticGestureCompleted will send som
| |
| 640 | |
| 631 // 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 |
| 632 // which may get in recursive loops). | 642 // which may get in recursive loops). |
| 633 void DelayedAutoResized(); | 643 void DelayedAutoResized(); |
| 634 | 644 |
| 635 void WindowSnapshotReachedScreen(int snapshot_id); | 645 void WindowSnapshotReachedScreen(int snapshot_id); |
| 636 | 646 |
| 637 void OnSnapshotDataReceived(int snapshot_id, | 647 void OnSnapshotDataReceived(int snapshot_id, |
| 638 const unsigned char* png, | 648 const unsigned char* png, |
| 639 size_t size); | 649 size_t size); |
| 640 | 650 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 814 // TODO(oshima): Remove this once crbug.com/563730 is addressed. | 824 // TODO(oshima): Remove this once crbug.com/563730 is addressed. |
| 815 bool scale_input_to_viewport_; | 825 bool scale_input_to_viewport_; |
| 816 | 826 |
| 817 // This value indicates how long to wait before we consider a renderer hung. | 827 // This value indicates how long to wait before we consider a renderer hung. |
| 818 base::TimeDelta hung_renderer_delay_; | 828 base::TimeDelta hung_renderer_delay_; |
| 819 | 829 |
| 820 // This value indicates how long to wait for a new compositor frame from a | 830 // This value indicates how long to wait for a new compositor frame from a |
| 821 // renderer process before clearing any previously displayed content. | 831 // renderer process before clearing any previously displayed content. |
| 822 base::TimeDelta new_content_rendering_delay_; | 832 base::TimeDelta new_content_rendering_delay_; |
| 823 | 833 |
| 834 std::vector<SyntheticPointerActionParams> action_param_list_; | |
| 835 | |
| 836 std::unique_ptr<SyntheticPointer> synthetic_pointer_; | |
| 837 | |
| 838 int index_map_[blink::WebTouchEvent::touchesLengthCap]; | |
| 839 | |
| 824 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 840 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 825 | 841 |
| 826 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 842 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 827 }; | 843 }; |
| 828 | 844 |
| 829 } // namespace content | 845 } // namespace content |
| 830 | 846 |
| 831 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 847 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |