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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // to see what it should do. | 170 // to see what it should do. |
171 virtual bool FocusLocationBarByDefault() = 0; | 171 virtual bool FocusLocationBarByDefault() = 0; |
172 | 172 |
173 // Focuses the location bar. | 173 // Focuses the location bar. |
174 virtual void SetFocusToLocationBar(bool select_all) = 0; | 174 virtual void SetFocusToLocationBar(bool select_all) = 0; |
175 | 175 |
176 // Returns true if views created for this delegate should be created in a | 176 // Returns true if views created for this delegate should be created in a |
177 // hidden state. | 177 // hidden state. |
178 virtual bool IsHidden() = 0; | 178 virtual bool IsHidden() = 0; |
179 | 179 |
| 180 // Returns the FrameTreeNode id of the outer WebContents that is hosting |
| 181 // this (inner) WebContents. This FrameTreeNode is the frame that |
| 182 // represents this inner WebContents within the FrameTree of the outer |
| 183 // WebContents. Returns FrameTreeNode::kFrameTreeNodeInvalidID if this |
| 184 // WebContents does not have an outer WebContents. |
| 185 virtual int GetOuterDelegateFrameTreeNodeID() = 0; |
| 186 |
180 protected: | 187 protected: |
181 virtual ~Delegate() {} | 188 virtual ~Delegate() {} |
182 }; | 189 }; |
183 | 190 |
184 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown | 191 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown |
185 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of | 192 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of |
186 // WebContentsImpl. | 193 // WebContentsImpl. |
187 static bool ClearRFHsPendingShutdown(FrameTreeNode* node); | 194 static bool ClearRFHsPendingShutdown(FrameTreeNode* node); |
188 | 195 |
189 // All three delegate pointers must be non-NULL and are not owned by this | 196 // All three delegate pointers must be non-NULL and are not owned by this |
(...skipping 25 matching lines...) Expand all Loading... |
215 return render_frame_host_.get(); | 222 return render_frame_host_.get(); |
216 } | 223 } |
217 | 224 |
218 // TODO(creis): Remove this when we no longer use RVH for navigation. | 225 // TODO(creis): Remove this when we no longer use RVH for navigation. |
219 RenderViewHostImpl* current_host() const; | 226 RenderViewHostImpl* current_host() const; |
220 | 227 |
221 // Returns the view associated with the current RenderViewHost, or NULL if | 228 // Returns the view associated with the current RenderViewHost, or NULL if |
222 // there is no current one. | 229 // there is no current one. |
223 RenderWidgetHostView* GetRenderWidgetHostView() const; | 230 RenderWidgetHostView* GetRenderWidgetHostView() const; |
224 | 231 |
| 232 // Returns the RenderWidgetHost of outer WebContents that can be used to fetch |
| 233 // the last keyboard event. |
| 234 // TODO(lazyboy): This can be removed once input events are sent directly to |
| 235 // remote frames. |
| 236 RenderWidgetHostImpl* GetOuterRenderWidgetHostForKeyboardInput(); |
| 237 |
225 RenderFrameProxyHost* GetProxyToParent(); | 238 RenderFrameProxyHost* GetProxyToParent(); |
| 239 // Returns the proxy to inner WebContents in the outer WebContents's |
| 240 // SiteInstance. Returns nullptr if this WebContents isn't part of inner/outer |
| 241 // relationship. |
| 242 RenderFrameProxyHost* GetProxyToOuterDelegate(); |
| 243 |
| 244 // Returns whether this manager belongs to a FrameTreeNode that is a main |
| 245 // frame in an inner WebContents. |
| 246 // TODO(lazyboy): Make this work correctly for subframes inside inner |
| 247 // WebContents too. |
| 248 bool ForInnerDelegate(); |
| 249 |
| 250 // Removes the FrameTreeNode in the outer WebContents that represents this |
| 251 // FrameTreeNode. |
| 252 void RemoveOuterDelegateFrame(); |
226 | 253 |
227 // Returns the pending RenderFrameHost, or NULL if there is no pending one. | 254 // Returns the pending RenderFrameHost, or NULL if there is no pending one. |
228 RenderFrameHostImpl* pending_frame_host() const { | 255 RenderFrameHostImpl* pending_frame_host() const { |
229 return pending_render_frame_host_.get(); | 256 return pending_render_frame_host_.get(); |
230 } | 257 } |
231 | 258 |
232 // Returns the speculative RenderFrameHost, or null if there is no speculative | 259 // Returns the speculative RenderFrameHost, or null if there is no speculative |
233 // one. | 260 // one. |
234 RenderFrameHostImpl* speculative_frame_host_for_testing() const { | 261 RenderFrameHostImpl* speculative_frame_host_for_testing() const { |
235 return speculative_render_frame_host_.get(); | 262 return speculative_render_frame_host_.get(); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 void OnDidUpdateName(const std::string& name); | 443 void OnDidUpdateName(const std::string& name); |
417 | 444 |
418 // Send updated origin to all frame proxies when the frame navigates to a new | 445 // Send updated origin to all frame proxies when the frame navigates to a new |
419 // origin. | 446 // origin. |
420 void OnDidUpdateOrigin(const url::Origin& origin); | 447 void OnDidUpdateOrigin(const url::Origin& origin); |
421 | 448 |
422 void EnsureRenderViewInitialized(FrameTreeNode* source, | 449 void EnsureRenderViewInitialized(FrameTreeNode* source, |
423 RenderViewHostImpl* render_view_host, | 450 RenderViewHostImpl* render_view_host, |
424 SiteInstance* instance); | 451 SiteInstance* instance); |
425 | 452 |
| 453 // Called on the RFHM of the inner WebContents to create a |
| 454 // RenderFrameProxyHost for this inner WebContents's frame in its outer |
| 455 // WebContents's SiteInstance. This SiteInstance is for the parent frame |
| 456 // |render_frame_host| in the outer WebContents |
| 457 void CreateOuterDelegateProxy(SiteInstance* outer_contents_site_instance, |
| 458 RenderFrameHostImpl* render_frame_host); |
| 459 |
| 460 // Sets the child RenderWidgetHostView for this frame, which much be part of |
| 461 // an inner WebContents. |
| 462 void SetRWHViewForInnerContents(RenderWidgetHostView* child_rwhv); |
| 463 |
426 private: | 464 private: |
427 friend class FrameTreeVisualizer; | 465 friend class FrameTreeVisualizer; |
428 friend class NavigatorTestWithBrowserSideNavigation; | 466 friend class NavigatorTestWithBrowserSideNavigation; |
429 friend class RenderFrameHostManagerTest; | 467 friend class RenderFrameHostManagerTest; |
430 friend class TestWebContents; | 468 friend class TestWebContents; |
431 | 469 |
432 // Stores information regarding a SiteInstance targeted at a specific URL to | 470 // Stores information regarding a SiteInstance targeted at a specific URL to |
433 // allow for comparisons without having to actually create new instances. It | 471 // allow for comparisons without having to actually create new instances. It |
434 // can point to an existing one or store the details needed to create a new | 472 // can point to an existing one or store the details needed to create a new |
435 // one. | 473 // one. |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 bool should_reuse_web_ui_; | 773 bool should_reuse_web_ui_; |
736 | 774 |
737 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 775 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
738 | 776 |
739 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 777 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
740 }; | 778 }; |
741 | 779 |
742 } // namespace content | 780 } // namespace content |
743 | 781 |
744 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 782 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |