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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 class RenderFrameHostManagerTest; | 37 class RenderFrameHostManagerTest; |
| 38 class RenderFrameProxyHost; | 38 class RenderFrameProxyHost; |
| 39 class RenderViewHost; | 39 class RenderViewHost; |
| 40 class RenderViewHostImpl; | 40 class RenderViewHostImpl; |
| 41 class RenderWidgetHostDelegate; | 41 class RenderWidgetHostDelegate; |
| 42 class RenderWidgetHostView; | 42 class RenderWidgetHostView; |
| 43 class TestWebContents; | 43 class TestWebContents; |
| 44 class WebUIImpl; | 44 class WebUIImpl; |
| 45 struct NavigationBeforeCommitInfo; | 45 struct NavigationBeforeCommitInfo; |
| 46 | 46 |
| 47 // Flag arguments for RenderFrameHostManager::CreateRenderFrame. | |
| 48 enum CreateRenderFrameFlags { | |
| 49 SWAPPED_OUT = 1 << 0, | |
|
Charlie Reis
2014/10/01 17:01:09
We typically comment each member of the enum here,
kenrb
2014/10/01 19:27:51
Comments added.
| |
| 50 FOR_MAIN_FRAME_NAVIGATION = 1 << 1, | |
| 51 HIDDEN = 1 << 2, | |
| 52 CREATE_RENDER_WIDGET_HOST = 1 << 3 | |
| 53 }; | |
| 54 | |
| 47 // Manages RenderFrameHosts for a FrameTreeNode. This class acts as a state | 55 // Manages RenderFrameHosts for a FrameTreeNode. This class acts as a state |
| 48 // machine to make cross-process navigations in a frame possible. | 56 // machine to make cross-process navigations in a frame possible. |
| 49 class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { | 57 class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { |
| 50 public: | 58 public: |
| 51 // Functions implemented by our owner that we need. | 59 // Functions implemented by our owner that we need. |
| 52 // | 60 // |
| 53 // TODO(brettw) Clean this up! These are all the functions in WebContentsImpl | 61 // TODO(brettw) Clean this up! These are all the functions in WebContentsImpl |
| 54 // that are required to run this class. The design should probably be better | 62 // that are required to run this class. The design should probably be better |
| 55 // such that these are more clear. | 63 // such that these are more clear. |
| 56 // | 64 // |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 void DidNavigateFrame(RenderFrameHostImpl* render_frame_host); | 257 void DidNavigateFrame(RenderFrameHostImpl* render_frame_host); |
| 250 | 258 |
| 251 // Called when a renderer sets its opener to null. | 259 // Called when a renderer sets its opener to null. |
| 252 void DidDisownOpener(RenderFrameHost* render_frame_host); | 260 void DidDisownOpener(RenderFrameHost* render_frame_host); |
| 253 | 261 |
| 254 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| | 262 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| |
| 255 // is true, it will be initially placed on the swapped out hosts list. | 263 // is true, it will be initially placed on the swapped out hosts list. |
| 256 // Returns the routing id of the *view* associated with the frame. | 264 // Returns the routing id of the *view* associated with the frame. |
| 257 int CreateRenderFrame(SiteInstance* instance, | 265 int CreateRenderFrame(SiteInstance* instance, |
| 258 int opener_route_id, | 266 int opener_route_id, |
| 259 bool swapped_out, | 267 int flags); |
| 260 bool for_main_frame_navigation, | |
| 261 bool hidden); | |
| 262 | 268 |
| 263 // Helper method to create and initialize a RenderFrameProxyHost and return | 269 // Helper method to create and initialize a RenderFrameProxyHost and return |
| 264 // its routing id. | 270 // its routing id. |
| 265 int CreateRenderFrameProxy(SiteInstance* instance); | 271 int CreateRenderFrameProxy(SiteInstance* instance); |
| 266 | 272 |
| 267 // Sets the passed passed interstitial as the currently showing interstitial. | 273 // Sets the passed passed interstitial as the currently showing interstitial. |
| 268 // |interstitial_page| should be non NULL (use the remove_interstitial_page | 274 // |interstitial_page| should be non NULL (use the remove_interstitial_page |
| 269 // method to unset the interstitial) and no interstitial page should be set | 275 // method to unset the interstitial) and no interstitial page should be set |
| 270 // when there is already a non NULL interstitial page set. | 276 // when there is already a non NULL interstitial page set. |
| 271 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { | 277 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 scoped_ptr<NavigationRequest> navigation_request_; | 542 scoped_ptr<NavigationRequest> navigation_request_; |
| 537 | 543 |
| 538 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 544 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 539 | 545 |
| 540 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 546 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 541 }; | 547 }; |
| 542 | 548 |
| 543 } // namespace content | 549 } // namespace content |
| 544 | 550 |
| 545 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 551 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |