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. |
| 182 // This FrameTreeNode is the frame that represents this inner WebContents |
| 183 // within the outer WebContents. |
| 184 // Returns -1 if this 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 RenderFrameProxyHost* GetProxyToOuterDelegate(); |
| 240 |
| 241 // Returns whether this manager belongs to a FrameTreeNode that is a main |
| 242 // frame in an inner WebContents. |
| 243 // |
| 244 // TODO(lazyboy): Make this work correctly for subframes inside inner |
| 245 // WebContents too. |
| 246 bool ForInnerDelegate(); |
| 247 |
| 248 // Removes the FrameTreeNode in the outer WebContents that represents this |
| 249 // FrameTreeNode. |
| 250 void RemoveOuterDelegateFrame(); |
226 | 251 |
227 // Returns the pending RenderFrameHost, or NULL if there is no pending one. | 252 // Returns the pending RenderFrameHost, or NULL if there is no pending one. |
228 RenderFrameHostImpl* pending_frame_host() const { | 253 RenderFrameHostImpl* pending_frame_host() const { |
229 return pending_render_frame_host_.get(); | 254 return pending_render_frame_host_.get(); |
230 } | 255 } |
231 | 256 |
232 // Returns the speculative RenderFrameHost, or null if there is no speculative | 257 // Returns the speculative RenderFrameHost, or null if there is no speculative |
233 // one. | 258 // one. |
234 RenderFrameHostImpl* speculative_frame_host_for_testing() const { | 259 RenderFrameHostImpl* speculative_frame_host_for_testing() const { |
235 return speculative_render_frame_host_.get(); | 260 return speculative_render_frame_host_.get(); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 void OnDidUpdateName(const std::string& name); | 440 void OnDidUpdateName(const std::string& name); |
416 | 441 |
417 // Send updated origin to all frame proxies when the frame navigates to a new | 442 // Send updated origin to all frame proxies when the frame navigates to a new |
418 // origin. | 443 // origin. |
419 void OnDidUpdateOrigin(const url::Origin& origin); | 444 void OnDidUpdateOrigin(const url::Origin& origin); |
420 | 445 |
421 void EnsureRenderViewInitialized(FrameTreeNode* source, | 446 void EnsureRenderViewInitialized(FrameTreeNode* source, |
422 RenderViewHostImpl* render_view_host, | 447 RenderViewHostImpl* render_view_host, |
423 SiteInstance* instance); | 448 SiteInstance* instance); |
424 | 449 |
| 450 // Called on the RFHM of the inner WebContents to create a proxy for this |
| 451 // inner WebContents's frame in its outer WebContents's process. |
| 452 void CreateOuterDelegateProxy(SiteInstance* outer_contents_site_instance, |
| 453 RenderFrameHostImpl* render_frame_host); |
| 454 |
| 455 // Sets the child RWHV for this frame, which much be part of an inner |
| 456 // WebContents. |
| 457 void SetRWHViewForInnerContents(RenderWidgetHostView* child_rwhv); |
| 458 |
425 private: | 459 private: |
426 friend class FrameTreeVisualizer; | 460 friend class FrameTreeVisualizer; |
427 friend class NavigatorTestWithBrowserSideNavigation; | 461 friend class NavigatorTestWithBrowserSideNavigation; |
428 friend class RenderFrameHostManagerTest; | 462 friend class RenderFrameHostManagerTest; |
429 friend class TestWebContents; | 463 friend class TestWebContents; |
430 | 464 |
431 // Stores information regarding a SiteInstance targeted at a specific URL to | 465 // Stores information regarding a SiteInstance targeted at a specific URL to |
432 // allow for comparisons without having to actually create new instances. It | 466 // allow for comparisons without having to actually create new instances. It |
433 // can point to an existing one or store the details needed to create a new | 467 // can point to an existing one or store the details needed to create a new |
434 // one. | 468 // one. |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 bool should_reuse_web_ui_; | 768 bool should_reuse_web_ui_; |
735 | 769 |
736 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 770 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
737 | 771 |
738 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 772 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
739 }; | 773 }; |
740 | 774 |
741 } // namespace content | 775 } // namespace content |
742 | 776 |
743 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 777 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |