Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDER_FRAME_HOST_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 // to see what it should do. | 167 // to see what it should do. |
| 168 virtual bool FocusLocationBarByDefault() = 0; | 168 virtual bool FocusLocationBarByDefault() = 0; |
| 169 | 169 |
| 170 // Focuses the location bar. | 170 // Focuses the location bar. |
| 171 virtual void SetFocusToLocationBar(bool select_all) = 0; | 171 virtual void SetFocusToLocationBar(bool select_all) = 0; |
| 172 | 172 |
| 173 // Returns true if views created for this delegate should be created in a | 173 // Returns true if views created for this delegate should be created in a |
| 174 // hidden state. | 174 // hidden state. |
| 175 virtual bool IsHidden() = 0; | 175 virtual bool IsHidden() = 0; |
| 176 | 176 |
| 177 // Returns the FTN id of the embedder delegate (WebContents) that is hosting | |
| 178 // this delegate (WebContents). Returns -1 if this WebContents does not | |
| 179 // have embedder delegate. | |
| 180 virtual int64 GetEmbedderFrameTreeNodeID() = 0; | |
| 181 | |
| 177 protected: | 182 protected: |
| 178 virtual ~Delegate() {} | 183 virtual ~Delegate() {} |
| 179 }; | 184 }; |
| 180 | 185 |
| 181 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown | 186 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown |
| 182 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of | 187 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of |
| 183 // WebContentsImpl. | 188 // WebContentsImpl. |
| 184 static bool ClearRFHsPendingShutdown(FrameTreeNode* node); | 189 static bool ClearRFHsPendingShutdown(FrameTreeNode* node); |
| 185 | 190 |
| 186 // All three delegate pointers must be non-NULL and are not owned by this | 191 // All three delegate pointers must be non-NULL and are not owned by this |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 213 } | 218 } |
| 214 | 219 |
| 215 // TODO(creis): Remove this when we no longer use RVH for navigation. | 220 // TODO(creis): Remove this when we no longer use RVH for navigation. |
| 216 RenderViewHostImpl* current_host() const; | 221 RenderViewHostImpl* current_host() const; |
| 217 | 222 |
| 218 // Returns the view associated with the current RenderViewHost, or NULL if | 223 // Returns the view associated with the current RenderViewHost, or NULL if |
| 219 // there is no current one. | 224 // there is no current one. |
| 220 RenderWidgetHostView* GetRenderWidgetHostView() const; | 225 RenderWidgetHostView* GetRenderWidgetHostView() const; |
| 221 | 226 |
| 222 RenderFrameProxyHost* GetProxyToParent(); | 227 RenderFrameProxyHost* GetProxyToParent(); |
| 228 RenderFrameProxyHost* GetProxyToEmbedder(); | |
| 229 | |
| 230 // Returns whether this manager belongs to a FTN that is a guest main frame. | |
| 231 bool IsGuest(); | |
|
nasko
2015/05/05 21:34:50
nit: I would prefer if we can come up with a more
lazyboy
2015/05/05 22:33:53
Acknowledged.
| |
| 223 | 232 |
| 224 // Returns the pending RenderFrameHost, or NULL if there is no pending one. | 233 // Returns the pending RenderFrameHost, or NULL if there is no pending one. |
| 225 RenderFrameHostImpl* pending_frame_host() const { | 234 RenderFrameHostImpl* pending_frame_host() const { |
| 226 return pending_render_frame_host_.get(); | 235 return pending_render_frame_host_.get(); |
| 227 } | 236 } |
| 228 | 237 |
| 229 // TODO(creis): Remove this when we no longer use RVH for navigation. | 238 // TODO(creis): Remove this when we no longer use RVH for navigation. |
| 230 RenderViewHostImpl* pending_render_view_host() const; | 239 RenderViewHostImpl* pending_render_view_host() const; |
| 231 | 240 |
| 232 // Returns the current committed Web UI or NULL if none applies. | 241 // Returns the current committed Web UI or NULL if none applies. |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 419 void OnDidUpdateName(const std::string& name); | 428 void OnDidUpdateName(const std::string& name); |
| 420 | 429 |
| 421 // Send updated origin to all frame proxies when the frame navigates to a new | 430 // Send updated origin to all frame proxies when the frame navigates to a new |
| 422 // origin. | 431 // origin. |
| 423 void OnDidUpdateOrigin(const url::Origin& origin); | 432 void OnDidUpdateOrigin(const url::Origin& origin); |
| 424 | 433 |
| 425 void EnsureRenderViewInitialized(FrameTreeNode* source, | 434 void EnsureRenderViewInitialized(FrameTreeNode* source, |
| 426 RenderViewHostImpl* render_view_host, | 435 RenderViewHostImpl* render_view_host, |
| 427 SiteInstance* instance); | 436 SiteInstance* instance); |
| 428 | 437 |
| 438 // Called on the guest RFHM to create a proxy for this guest frame in its | |
| 439 // embedder process. | |
| 440 // Returns the proxy routing ID. | |
| 441 int CreateEmbedderProxy(SiteInstance* embedder_site_instance); | |
| 442 | |
| 443 // Called on the embedder RFHM to replace the initial guest frame in the | |
| 444 // embedder with the proxy that has routing id | |
| 445 // |proxy_to_embedder_routing_id|. | |
| 446 void ReplaceWithGuestProxy(int proxy_to_embedder_routing_id); | |
| 447 | |
| 448 // Sets the child RWHV for this guest frame. | |
| 449 void SetGuestRWHView(RenderWidgetHostView* child_rwhv); | |
| 450 | |
| 429 private: | 451 private: |
| 430 friend class FrameTreeVisualizer; | 452 friend class FrameTreeVisualizer; |
| 431 friend class NavigatorTestWithBrowserSideNavigation; | 453 friend class NavigatorTestWithBrowserSideNavigation; |
| 432 friend class RenderFrameHostManagerTest; | 454 friend class RenderFrameHostManagerTest; |
| 433 friend class TestWebContents; | 455 friend class TestWebContents; |
| 434 | 456 |
| 435 // Stores information regarding a SiteInstance targeted at a specific URL to | 457 // Stores information regarding a SiteInstance targeted at a specific URL to |
| 436 // allow for comparisons without having to actually create new instances. It | 458 // allow for comparisons without having to actually create new instances. It |
| 437 // can point to an existing one or store the details needed to create a new | 459 // can point to an existing one or store the details needed to create a new |
| 438 // one. | 460 // one. |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 742 bool should_reuse_web_ui_; | 764 bool should_reuse_web_ui_; |
| 743 | 765 |
| 744 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 766 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 745 | 767 |
| 746 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 768 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 747 }; | 769 }; |
| 748 | 770 |
| 749 } // namespace content | 771 } // namespace content |
| 750 | 772 |
| 751 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 773 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |