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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 RenderViewHost* old_host, | 149 RenderViewHost* old_host, |
150 RenderViewHost* new_host) = 0; | 150 RenderViewHost* new_host) = 0; |
151 virtual NavigationControllerImpl& | 151 virtual NavigationControllerImpl& |
152 GetControllerForRenderManager() = 0; | 152 GetControllerForRenderManager() = 0; |
153 | 153 |
154 // Returns the navigation entry of the current navigation, or NULL if there | 154 // Returns the navigation entry of the current navigation, or NULL if there |
155 // is none. | 155 // is none. |
156 virtual NavigationEntry* | 156 virtual NavigationEntry* |
157 GetLastCommittedNavigationEntryForRenderManager() = 0; | 157 GetLastCommittedNavigationEntryForRenderManager() = 0; |
158 | 158 |
| 159 // Returns the interstitial page showing in the delegate, or null if there |
| 160 // is none. |
| 161 virtual InterstitialPageImpl* GetInterstitialForRenderManager() = 0; |
| 162 |
159 // Returns true if the location bar should be focused by default rather than | 163 // Returns true if the location bar should be focused by default rather than |
160 // the page contents. The view calls this function when the tab is focused | 164 // the page contents. The view calls this function when the tab is focused |
161 // to see what it should do. | 165 // to see what it should do. |
162 virtual bool FocusLocationBarByDefault() = 0; | 166 virtual bool FocusLocationBarByDefault() = 0; |
163 | 167 |
164 // Focuses the location bar. | 168 // Focuses the location bar. |
165 virtual void SetFocusToLocationBar(bool select_all) = 0; | 169 virtual void SetFocusToLocationBar(bool select_all) = 0; |
166 | 170 |
167 // Returns true if views created for this delegate should be created in a | 171 // Returns true if views created for this delegate should be created in a |
168 // hidden state. | 172 // hidden state. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // Helper method to create and initialize a RenderFrameProxyHost and return | 341 // Helper method to create and initialize a RenderFrameProxyHost and return |
338 // its routing id. | 342 // its routing id. |
339 int CreateRenderFrameProxy(SiteInstance* instance); | 343 int CreateRenderFrameProxy(SiteInstance* instance); |
340 | 344 |
341 // Creates proxies for a new child frame at FrameTreeNode |child| in all | 345 // Creates proxies for a new child frame at FrameTreeNode |child| in all |
342 // SiteInstances for which the current frame has proxies. This method is | 346 // SiteInstances for which the current frame has proxies. This method is |
343 // called on the parent of a new child frame before the child leaves the | 347 // called on the parent of a new child frame before the child leaves the |
344 // SiteInstance. | 348 // SiteInstance. |
345 void CreateProxiesForChildFrame(FrameTreeNode* child); | 349 void CreateProxiesForChildFrame(FrameTreeNode* child); |
346 | 350 |
347 // Sets the passed passed interstitial as the currently showing interstitial. | |
348 // |interstitial_page| should be non NULL (use the remove_interstitial_page | |
349 // method to unset the interstitial) and no interstitial page should be set | |
350 // when there is already a non NULL interstitial page set. | |
351 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { | |
352 DCHECK(!interstitial_page_ && interstitial_page); | |
353 interstitial_page_ = interstitial_page; | |
354 } | |
355 | |
356 // Unsets the currently showing interstitial. | |
357 void remove_interstitial_page() { | |
358 DCHECK(interstitial_page_); | |
359 interstitial_page_ = NULL; | |
360 } | |
361 | |
362 // Returns the currently showing interstitial, NULL if no interstitial is | |
363 // showing. | |
364 InterstitialPageImpl* interstitial_page() const { return interstitial_page_; } | |
365 | |
366 // Returns the swapped out RenderViewHost for the given SiteInstance, if any. | 351 // Returns the swapped out RenderViewHost for the given SiteInstance, if any. |
367 // This method is *deprecated* and GetRenderFrameProxyHost should be used. | 352 // This method is *deprecated* and GetRenderFrameProxyHost should be used. |
368 RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance) const; | 353 RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance) const; |
369 | 354 |
370 // Returns the RenderFrameProxyHost for the given SiteInstance, if any. | 355 // Returns the RenderFrameProxyHost for the given SiteInstance, if any. |
371 RenderFrameProxyHost* GetRenderFrameProxyHost( | 356 RenderFrameProxyHost* GetRenderFrameProxyHost( |
372 SiteInstance* instance) const; | 357 SiteInstance* instance) const; |
373 | 358 |
374 // If |render_frame_host| is on the pending deletion list, this deletes it. | 359 // If |render_frame_host| is on the pending deletion list, this deletes it. |
375 // Returns whether it was deleted. | 360 // Returns whether it was deleted. |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 std::unique_ptr<NavigationHandleImpl> transfer_navigation_handle_; | 778 std::unique_ptr<NavigationHandleImpl> transfer_navigation_handle_; |
794 | 779 |
795 // Proxy hosts, indexed by site instance ID. | 780 // Proxy hosts, indexed by site instance ID. |
796 std::unordered_map<int32_t, std::unique_ptr<RenderFrameProxyHost>> | 781 std::unordered_map<int32_t, std::unique_ptr<RenderFrameProxyHost>> |
797 proxy_hosts_; | 782 proxy_hosts_; |
798 | 783 |
799 // A list of RenderFrameHosts waiting to shut down after swapping out. | 784 // A list of RenderFrameHosts waiting to shut down after swapping out. |
800 using RFHPendingDeleteList = std::list<std::unique_ptr<RenderFrameHostImpl>>; | 785 using RFHPendingDeleteList = std::list<std::unique_ptr<RenderFrameHostImpl>>; |
801 RFHPendingDeleteList pending_delete_hosts_; | 786 RFHPendingDeleteList pending_delete_hosts_; |
802 | 787 |
803 // The intersitial page currently shown if any, not own by this class | |
804 // (the InterstitialPage is self-owned, it deletes itself when hidden). | |
805 InterstitialPageImpl* interstitial_page_; | |
806 | |
807 // PlzNavigate | 788 // PlzNavigate |
808 // Stores a speculative RenderFrameHost which is created early in a navigation | 789 // Stores a speculative RenderFrameHost which is created early in a navigation |
809 // so a renderer process can be started in parallel, if needed. | 790 // so a renderer process can be started in parallel, if needed. |
810 // This is purely a performance optimization and is not required for correct | 791 // This is purely a performance optimization and is not required for correct |
811 // behavior. The speculative RenderFrameHost might be discarded later on if | 792 // behavior. The speculative RenderFrameHost might be discarded later on if |
812 // the final URL's SiteInstance isn't compatible with the one used to create | 793 // the final URL's SiteInstance isn't compatible with the one used to create |
813 // it. | 794 // it. |
814 // Note: PlzNavigate only uses the speculative RenderFrameHost, not the | 795 // Note: PlzNavigate only uses the speculative RenderFrameHost, not the |
815 // pending one. | 796 // pending one. |
816 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | 797 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
817 | 798 |
818 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 799 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
819 | 800 |
820 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 801 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
821 }; | 802 }; |
822 | 803 |
823 } // namespace content | 804 } // namespace content |
824 | 805 |
825 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 806 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |