| 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 15 matching lines...) Expand all Loading... |
| 26 #include "base/timer/elapsed_timer.h" | 26 #include "base/timer/elapsed_timer.h" |
| 27 #include "build/build_config.h" | 27 #include "build/build_config.h" |
| 28 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" | 28 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
| 29 #include "cc/resources/shared_bitmap.h" | 29 #include "cc/resources/shared_bitmap.h" |
| 30 #include "cc/surfaces/frame_sink_id.h" | 30 #include "cc/surfaces/frame_sink_id.h" |
| 31 #include "content/browser/renderer_host/event_with_latency_info.h" | 31 #include "content/browser/renderer_host/event_with_latency_info.h" |
| 32 #include "content/browser/renderer_host/input/input_ack_handler.h" | 32 #include "content/browser/renderer_host/input/input_ack_handler.h" |
| 33 #include "content/browser/renderer_host/input/input_router_client.h" | 33 #include "content/browser/renderer_host/input/input_router_client.h" |
| 34 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker
.h" | 34 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker
.h" |
| 35 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 35 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 36 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
| 36 #include "content/browser/renderer_host/input/touch_emulator_client.h" | 37 #include "content/browser/renderer_host/input/touch_emulator_client.h" |
| 37 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 38 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 38 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 39 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 39 #include "content/common/drag_event_source_info.h" | 40 #include "content/common/drag_event_source_info.h" |
| 40 #include "content/common/input/input_event_ack_state.h" | 41 #include "content/common/input/input_event_ack_state.h" |
| 41 #include "content/common/input/synthetic_gesture_packet.h" | 42 #include "content/common/input/synthetic_gesture_packet.h" |
| 42 #include "content/common/render_widget_surface_properties.h" | 43 #include "content/common/render_widget_surface_properties.h" |
| 43 #include "content/common/view_message_enums.h" | 44 #include "content/common/view_message_enums.h" |
| 44 #include "content/public/browser/render_widget_host.h" | 45 #include "content/public/browser/render_widget_host.h" |
| 45 #include "content/public/common/page_zoom.h" | 46 #include "content/public/common/page_zoom.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 struct ScreenInfo; | 95 struct ScreenInfo; |
| 95 struct TextInputState; | 96 struct TextInputState; |
| 96 | 97 |
| 97 // This implements the RenderWidgetHost interface that is exposed to | 98 // This implements the RenderWidgetHost interface that is exposed to |
| 98 // embedders of content, and adds things only visible to content. | 99 // embedders of content, and adds things only visible to content. |
| 99 class CONTENT_EXPORT RenderWidgetHostImpl | 100 class CONTENT_EXPORT RenderWidgetHostImpl |
| 100 : public RenderWidgetHost, | 101 : public RenderWidgetHost, |
| 101 public InputRouterClient, | 102 public InputRouterClient, |
| 102 public InputAckHandler, | 103 public InputAckHandler, |
| 103 public TouchEmulatorClient, | 104 public TouchEmulatorClient, |
| 105 public NON_EXPORTED_BASE(SyntheticGestureController::Delegate), |
| 104 public NON_EXPORTED_BASE(cc::mojom::MojoCompositorFrameSink), | 106 public NON_EXPORTED_BASE(cc::mojom::MojoCompositorFrameSink), |
| 105 public IPC::Listener { | 107 public IPC::Listener { |
| 106 public: | 108 public: |
| 107 // |routing_id| must not be MSG_ROUTING_NONE. | 109 // |routing_id| must not be MSG_ROUTING_NONE. |
| 108 // If this object outlives |delegate|, DetachDelegate() must be called when | 110 // If this object outlives |delegate|, DetachDelegate() must be called when |
| 109 // |delegate| goes away. | 111 // |delegate| goes away. |
| 110 RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, | 112 RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |
| 111 RenderProcessHost* process, | 113 RenderProcessHost* process, |
| 112 int32_t routing_id, | 114 int32_t routing_id, |
| 113 bool hidden); | 115 bool hidden); |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 void RequestCompositionUpdates(bool immediate_request, bool monitor_updates); | 575 void RequestCompositionUpdates(bool immediate_request, bool monitor_updates); |
| 574 | 576 |
| 575 void RequestMojoCompositorFrameSink( | 577 void RequestMojoCompositorFrameSink( |
| 576 cc::mojom::MojoCompositorFrameSinkRequest request, | 578 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 577 cc::mojom::MojoCompositorFrameSinkClientPtr client); | 579 cc::mojom::MojoCompositorFrameSinkClientPtr client); |
| 578 | 580 |
| 579 const cc::CompositorFrameMetadata& last_frame_metadata() { | 581 const cc::CompositorFrameMetadata& last_frame_metadata() { |
| 580 return last_frame_metadata_; | 582 return last_frame_metadata_; |
| 581 } | 583 } |
| 582 | 584 |
| 585 // SyntheticGestureController::Delegate: |
| 586 void RequestBeginFrameForSynthesizedInput( |
| 587 base::OnceClosure begin_frame_callback) override; |
| 588 bool HasGestureStopped() override; |
| 589 |
| 583 // cc::mojom::MojoCompositorFrameSink implementation. | 590 // cc::mojom::MojoCompositorFrameSink implementation. |
| 584 void SetNeedsBeginFrame(bool needs_begin_frame) override; | 591 void SetNeedsBeginFrame(bool needs_begin_frame) override; |
| 585 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, | 592 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, |
| 586 cc::CompositorFrame frame) override; | 593 cc::CompositorFrame frame) override; |
| 587 void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override; | 594 void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override; |
| 588 void EvictCurrentSurface() override {} | 595 void EvictCurrentSurface() override {} |
| 589 | 596 |
| 590 protected: | 597 protected: |
| 591 // --------------------------------------------------------------------------- | 598 // --------------------------------------------------------------------------- |
| 592 // The following method is overridden by RenderViewHost to send upwards to | 599 // The following method is overridden by RenderViewHost to send upwards to |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 // content but failed to produce a compositor frame in a defined time. | 638 // content but failed to produce a compositor frame in a defined time. |
| 632 void ClearDisplayedGraphics(); | 639 void ClearDisplayedGraphics(); |
| 633 | 640 |
| 634 // Called if we know the renderer is responsive. When we currently think the | 641 // Called if we know the renderer is responsive. When we currently think the |
| 635 // renderer is unresponsive, this will clear that state and call | 642 // renderer is unresponsive, this will clear that state and call |
| 636 // NotifyRendererResponsive. | 643 // NotifyRendererResponsive. |
| 637 void RendererIsResponsive(); | 644 void RendererIsResponsive(); |
| 638 | 645 |
| 639 void OnGpuSwapBuffersCompletedInternal(const ui::LatencyInfo& latency_info); | 646 void OnGpuSwapBuffersCompletedInternal(const ui::LatencyInfo& latency_info); |
| 640 | 647 |
| 641 void RequestBeginFrameForSynthesizedInput( | |
| 642 base::OnceClosure begin_frame_callback); | |
| 643 | 648 |
| 644 // IPC message handlers | 649 // IPC message handlers |
| 645 void OnRenderProcessGone(int status, int error_code); | 650 void OnRenderProcessGone(int status, int error_code); |
| 646 void OnClose(); | 651 void OnClose(); |
| 647 void OnUpdateScreenRectsAck(); | 652 void OnUpdateScreenRectsAck(); |
| 648 void OnRequestMove(const gfx::Rect& pos); | 653 void OnRequestMove(const gfx::Rect& pos); |
| 649 void OnSetTooltipText(const base::string16& tooltip_text, | 654 void OnSetTooltipText(const base::string16& tooltip_text, |
| 650 blink::WebTextDirection text_direction_hint); | 655 blink::WebTextDirection text_direction_hint); |
| 651 void OnBeginFrameDidNotSwap(const cc::BeginFrameAck& ack); | 656 void OnBeginFrameDidNotSwap(const cc::BeginFrameAck& ack); |
| 652 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 657 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 base::OnceClosure begin_frame_callback_; | 990 base::OnceClosure begin_frame_callback_; |
| 986 | 991 |
| 987 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 992 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 988 | 993 |
| 989 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 994 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 990 }; | 995 }; |
| 991 | 996 |
| 992 } // namespace content | 997 } // namespace content |
| 993 | 998 |
| 994 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 999 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |