| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| 7 | 7 |
| 8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace IPC { | 22 namespace IPC { |
| 23 class Message; | 23 class Message; |
| 24 } | 24 } |
| 25 | 25 |
| 26 struct FrameHostMsg_CompositorFrameSwappedACK_Params; | 26 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
| 27 struct FrameHostMsg_ReclaimCompositorResources_Params; | 27 struct FrameHostMsg_ReclaimCompositorResources_Params; |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 class RenderFrameProxyHost; | 30 class RenderFrameProxyHost; |
| 31 class RenderWidgetHostImpl; | 31 class RenderWidgetHostImpl; |
| 32 class RenderWidgetHostViewBase; |
| 32 class RenderWidgetHostViewChildFrame; | 33 class RenderWidgetHostViewChildFrame; |
| 34 class WebCursor; |
| 33 | 35 |
| 34 // CrossProcessFrameConnector provides the platform view abstraction for | 36 // CrossProcessFrameConnector provides the platform view abstraction for |
| 35 // RenderWidgetHostViewChildFrame allowing RWHVChildFrame to remain ignorant | 37 // RenderWidgetHostViewChildFrame allowing RWHVChildFrame to remain ignorant |
| 36 // of RenderFrameHost. | 38 // of RenderFrameHost. |
| 37 // | 39 // |
| 38 // The RenderWidgetHostView of an out-of-process child frame needs to | 40 // The RenderWidgetHostView of an out-of-process child frame needs to |
| 39 // communicate with the RenderFrameProxyHost representing this frame in the | 41 // communicate with the RenderFrameProxyHost representing this frame in the |
| 40 // process of the parent frame. For example, assume you have this page: | 42 // process of the parent frame. For example, assume you have this page: |
| 41 // | 43 // |
| 42 // ----------------- | 44 // ----------------- |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 int route_id, | 91 int route_id, |
| 90 scoped_ptr<cc::CompositorFrame> frame); | 92 scoped_ptr<cc::CompositorFrame> frame); |
| 91 virtual void SetChildFrameSurface(const cc::SurfaceId& surface_id, | 93 virtual void SetChildFrameSurface(const cc::SurfaceId& surface_id, |
| 92 const gfx::Size& frame_size, | 94 const gfx::Size& frame_size, |
| 93 float scale_factor, | 95 float scale_factor, |
| 94 const cc::SurfaceSequence& sequence); | 96 const cc::SurfaceSequence& sequence); |
| 95 | 97 |
| 96 gfx::Rect ChildFrameRect(); | 98 gfx::Rect ChildFrameRect(); |
| 97 float device_scale_factor() const { return device_scale_factor_; } | 99 float device_scale_factor() const { return device_scale_factor_; } |
| 98 void GetScreenInfo(blink::WebScreenInfo* results); | 100 void GetScreenInfo(blink::WebScreenInfo* results); |
| 101 void UpdateCursor(const WebCursor& cursor); |
| 99 | 102 |
| 100 private: | 103 private: |
| 101 // Handlers for messages received from the parent frame. | 104 // Handlers for messages received from the parent frame. |
| 102 void OnCompositorFrameSwappedACK( | 105 void OnCompositorFrameSwappedACK( |
| 103 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); | 106 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); |
| 104 void OnReclaimCompositorResources( | 107 void OnReclaimCompositorResources( |
| 105 const FrameHostMsg_ReclaimCompositorResources_Params& params); | 108 const FrameHostMsg_ReclaimCompositorResources_Params& params); |
| 106 void OnForwardInputEvent(const blink::WebInputEvent* event); | 109 void OnForwardInputEvent(const blink::WebInputEvent* event); |
| 107 void OnFrameRectChanged(const gfx::Rect& frame_rect); | 110 void OnFrameRectChanged(const gfx::Rect& frame_rect); |
| 108 void OnInitializeChildFrame(gfx::Rect frame_rect, float scale_factor); | 111 void OnInitializeChildFrame(gfx::Rect frame_rect, float scale_factor); |
| 109 void OnSatisfySequence(const cc::SurfaceSequence& sequence); | 112 void OnSatisfySequence(const cc::SurfaceSequence& sequence); |
| 110 void OnRequireSequence(const cc::SurfaceId& id, | 113 void OnRequireSequence(const cc::SurfaceId& id, |
| 111 const cc::SurfaceSequence& sequence); | 114 const cc::SurfaceSequence& sequence); |
| 112 | 115 |
| 113 void SetDeviceScaleFactor(float scale_factor); | 116 void SetDeviceScaleFactor(float scale_factor); |
| 114 void SetSize(gfx::Rect frame_rect); | 117 void SetSize(gfx::Rect frame_rect); |
| 115 | 118 |
| 119 // Retrieve the view for the top-level frame under the same WebContents. |
| 120 RenderWidgetHostViewBase* GetRootRenderWidgetHostView(); |
| 121 |
| 116 // The RenderFrameProxyHost that routes messages to the parent frame's | 122 // The RenderFrameProxyHost that routes messages to the parent frame's |
| 117 // renderer process. | 123 // renderer process. |
| 118 RenderFrameProxyHost* frame_proxy_in_parent_renderer_; | 124 RenderFrameProxyHost* frame_proxy_in_parent_renderer_; |
| 119 | 125 |
| 120 // The RenderWidgetHostView for the frame. Initially NULL. | 126 // The RenderWidgetHostView for the frame. Initially NULL. |
| 121 RenderWidgetHostViewChildFrame* view_; | 127 RenderWidgetHostViewChildFrame* view_; |
| 122 | 128 |
| 123 gfx::Rect child_frame_rect_; | 129 gfx::Rect child_frame_rect_; |
| 124 float device_scale_factor_; | 130 float device_scale_factor_; |
| 125 }; | 131 }; |
| 126 | 132 |
| 127 } // namespace content | 133 } // namespace content |
| 128 | 134 |
| 129 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 135 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| 130 | 136 |
| OLD | NEW |