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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 // to see what it should do. | 168 // to see what it should do. |
169 virtual bool FocusLocationBarByDefault() = 0; | 169 virtual bool FocusLocationBarByDefault() = 0; |
170 | 170 |
171 // Focuses the location bar. | 171 // Focuses the location bar. |
172 virtual void SetFocusToLocationBar(bool select_all) = 0; | 172 virtual void SetFocusToLocationBar(bool select_all) = 0; |
173 | 173 |
174 // Returns true if views created for this delegate should be created in a | 174 // Returns true if views created for this delegate should be created in a |
175 // hidden state. | 175 // hidden state. |
176 virtual bool IsHidden() = 0; | 176 virtual bool IsHidden() = 0; |
177 | 177 |
178 // Returns the FrameTreeNode id of the outer WebContents that is hosting | |
179 // this (inner) WebContents. | |
180 // Returns -1 if this WebContents does not have an outer WebContents. | |
181 virtual int GetOuterDelegateFrameTreeNodeID() = 0; | |
182 | |
178 protected: | 183 protected: |
179 virtual ~Delegate() {} | 184 virtual ~Delegate() {} |
180 }; | 185 }; |
181 | 186 |
182 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown | 187 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown |
183 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of | 188 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of |
184 // WebContentsImpl. | 189 // WebContentsImpl. |
185 static bool ClearRFHsPendingShutdown(FrameTreeNode* node); | 190 static bool ClearRFHsPendingShutdown(FrameTreeNode* node); |
186 | 191 |
187 // All three delegate pointers must be non-NULL and are not owned by this | 192 // All three delegate pointers must be non-NULL and are not owned by this |
(...skipping 25 matching lines...) Expand all Loading... | |
213 return render_frame_host_.get(); | 218 return render_frame_host_.get(); |
214 } | 219 } |
215 | 220 |
216 // TODO(creis): Remove this when we no longer use RVH for navigation. | 221 // TODO(creis): Remove this when we no longer use RVH for navigation. |
217 RenderViewHostImpl* current_host() const; | 222 RenderViewHostImpl* current_host() const; |
218 | 223 |
219 // Returns the view associated with the current RenderViewHost, or NULL if | 224 // Returns the view associated with the current RenderViewHost, or NULL if |
220 // there is no current one. | 225 // there is no current one. |
221 RenderWidgetHostView* GetRenderWidgetHostView() const; | 226 RenderWidgetHostView* GetRenderWidgetHostView() const; |
222 | 227 |
228 // Returns the RVH of outer WebContents that can used to fetch the last | |
nasko
2015/05/28 22:13:46
nit: RenderViewHost of the outer
lazyboy
2015/05/29 00:02:24
Done.
| |
229 // keyboard event. | |
230 // TODO(lazyboy): This can be removed once we input events are sent directly | |
nasko
2015/05/28 22:13:46
nit: Extra "we"?
nit: Input events won't be sent t
lazyboy
2015/05/29 00:02:24
Done.
| |
231 // to remote frames. | |
232 RenderViewHostImpl* GetOuterRenderViewHostForKeyboardInput(); | |
233 | |
223 RenderFrameProxyHost* GetProxyToParent(); | 234 RenderFrameProxyHost* GetProxyToParent(); |
235 RenderFrameProxyHost* GetProxyToOuterDelegate(); | |
236 | |
237 // Returns whether this manager belongs to a FrameTreeNode that is a main | |
238 // frame in an inner WebContents. | |
239 // | |
240 // TODO(lazyboy): Make this work correctly for subframes inside inner | |
241 // WebContents too. | |
242 bool ForInnerDelegate(); | |
224 | 243 |
225 // Returns the pending RenderFrameHost, or NULL if there is no pending one. | 244 // Returns the pending RenderFrameHost, or NULL if there is no pending one. |
226 RenderFrameHostImpl* pending_frame_host() const { | 245 RenderFrameHostImpl* pending_frame_host() const { |
227 return pending_render_frame_host_.get(); | 246 return pending_render_frame_host_.get(); |
228 } | 247 } |
229 | 248 |
230 // TODO(creis): Remove this when we no longer use RVH for navigation. | 249 // TODO(creis): Remove this when we no longer use RVH for navigation. |
231 RenderViewHostImpl* pending_render_view_host() const; | 250 RenderViewHostImpl* pending_render_view_host() const; |
232 | 251 |
233 // Returns the current committed Web UI or NULL if none applies. | 252 // Returns the current committed Web UI or NULL if none applies. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 void OnDidUpdateName(const std::string& name); | 426 void OnDidUpdateName(const std::string& name); |
408 | 427 |
409 // Send updated origin to all frame proxies when the frame navigates to a new | 428 // Send updated origin to all frame proxies when the frame navigates to a new |
410 // origin. | 429 // origin. |
411 void OnDidUpdateOrigin(const url::Origin& origin); | 430 void OnDidUpdateOrigin(const url::Origin& origin); |
412 | 431 |
413 void EnsureRenderViewInitialized(FrameTreeNode* source, | 432 void EnsureRenderViewInitialized(FrameTreeNode* source, |
414 RenderViewHostImpl* render_view_host, | 433 RenderViewHostImpl* render_view_host, |
415 SiteInstance* instance); | 434 SiteInstance* instance); |
416 | 435 |
436 // Called on the RFHM of the inner WebContents to create a proxy for this | |
437 // inner WebContents's frame in its outer WebContents's process. | |
438 // Returns the proxy routing ID. | |
439 int CreateOuterDelegateProxy(SiteInstance* outer_contents_site_instance); | |
440 | |
441 // Swaps the frame with the given proxy. | |
442 void SwapFrameWithProxy(int proxy_to_outer_delegate_routing_id); | |
443 | |
444 // Sets the child RWHV for this frame that is part of an inner WebContents. | |
445 void SetRWHViewForInnerContents(RenderWidgetHostView* child_rwhv); | |
446 | |
417 private: | 447 private: |
418 friend class FrameTreeVisualizer; | 448 friend class FrameTreeVisualizer; |
419 friend class NavigatorTestWithBrowserSideNavigation; | 449 friend class NavigatorTestWithBrowserSideNavigation; |
420 friend class RenderFrameHostManagerTest; | 450 friend class RenderFrameHostManagerTest; |
421 friend class TestWebContents; | 451 friend class TestWebContents; |
422 | 452 |
423 // Stores information regarding a SiteInstance targeted at a specific URL to | 453 // Stores information regarding a SiteInstance targeted at a specific URL to |
424 // allow for comparisons without having to actually create new instances. It | 454 // allow for comparisons without having to actually create new instances. It |
425 // can point to an existing one or store the details needed to create a new | 455 // can point to an existing one or store the details needed to create a new |
426 // one. | 456 // one. |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 bool should_reuse_web_ui_; | 760 bool should_reuse_web_ui_; |
731 | 761 |
732 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 762 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
733 | 763 |
734 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 764 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
735 }; | 765 }; |
736 | 766 |
737 } // namespace content | 767 } // namespace content |
738 | 768 |
739 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 769 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |