Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_impl.h |
| diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h |
| index 720235227365ec2a878d20f71b2ef2cba69e3af9..2657e8393f299d8ec8569465681bc97418f4c38c 100644 |
| --- a/content/browser/frame_host/render_frame_host_impl.h |
| +++ b/content/browser/frame_host/render_frame_host_impl.h |
| @@ -59,7 +59,9 @@ class RenderFrameHostDelegate; |
| class RenderFrameProxyHost; |
| class RenderProcessHost; |
| class RenderViewHostImpl; |
| +class RenderWidgetHostDelegate; |
| class RenderWidgetHostImpl; |
| +class RenderWidgetHostView; |
| class StreamHandle; |
| class TimeoutMonitor; |
| struct CommitNavigationParams; |
| @@ -78,7 +80,11 @@ enum CreateRenderFrameFlags { |
| // top-level frame. |
| CREATE_RF_FOR_MAIN_FRAME_NAVIGATION = 1 << 1, |
| // The RenderFrame is initially hidden. |
| - CREATE_RF_HIDDEN = 1 << 2 |
| + CREATE_RF_HIDDEN = 1 << 2, |
| + // The RenderFrameHost will have a new RenderWidgetHost created and |
| + // attached to it. This is used when the RenderFrameHost is in a different |
| + // process from its parent frame. |
| + CREATE_RF_NEEDS_RENDER_WIDGET_HOST = 1 << 3 |
| }; |
| class CONTENT_EXPORT RenderFrameHostImpl |
| @@ -167,6 +173,9 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| // cross-process subframe navigations in --site-per-process. |
| bool CreateRenderFrame(int parent_routing_id, int proxy_routing_id); |
| + // This is called to create RenderWidgetHosts for out-of-process iframes. |
| + void CreateRenderWidgetHost(RenderWidgetHostDelegate* delegate, bool hidden); |
|
Charlie Reis
2015/01/07 23:58:41
Should this be deleted? I don't see any implement
kenrb
2015/01/14 18:13:56
Done.
|
| + |
| // Returns whether the RenderFrame in the renderer process has been created |
| // and still has a connection. This is valid for all frames. |
| bool IsRenderFrameLive(); |
| @@ -189,10 +198,17 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| RenderViewHostImpl* render_view_host() { return render_view_host_; } |
| RenderFrameHostDelegate* delegate() { return delegate_; } |
| FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
| - // TODO(nasko): The RenderWidgetHost will be owned by RenderFrameHost in |
| - // the future, so update this accessor to return the right pointer. |
| + |
| + // This returns the RenderFrameHost's owned RenderWidgetHost if it has one, |
| + // or else it returns nullptr. |
| + // If the RenderFrameHost is the page's main frame, this returns instead a |
| + // pointer to the RenderViewHost (which inherits RenderWidgetHost). |
| RenderWidgetHostImpl* GetRenderWidgetHost(); |
| + // This returns the RenderWidgetHostView that can be used to control |
| + // focus and visibility for this frame. |
| + RenderWidgetHostView* GetView(); |
| + |
| // This function is called when this is a swapped out RenderFrameHost that |
| // lives in the same process as the parent frame. The |
| // |cross_process_frame_connector| allows the non-swapped-out |
| @@ -397,6 +413,7 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| // into WebContentsObserver::FrameDetached for now. |
| RenderFrameHostImpl(RenderViewHostImpl* render_view_host, |
| RenderFrameHostDelegate* delegate, |
| + RenderWidgetHostDelegate* rwh_delegate, |
| FrameTree* frame_tree, |
| FrameTreeNode* frame_tree_node, |
| int routing_id, |
| @@ -536,6 +553,14 @@ class CONTENT_EXPORT RenderFrameHostImpl |
| // ExecuteJavaScript and their corresponding callbacks. |
| std::map<int, JavaScriptResultCallback> javascript_callbacks_; |
| + // RenderFrameHosts that need management of the rendering and input events |
| + // for their frame subtrees require RenderWidgetHosts. This typically |
| + // means frames that are rendered in different processes from their parent |
| + // frames. |
| + // TODO(kenrb): Later this will also be used on the top-level frame, when |
| + // RenderFrameHost owns its RenderViewHost. |
| + scoped_ptr<RenderWidgetHostImpl> render_widget_host_; |
| + |
| int routing_id_; |
| // The current state of this RenderFrameHost. |