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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // | 50 // |
51 // There is additional complexity that some of the functions we need in | 51 // There is additional complexity that some of the functions we need in |
52 // WebContentsImpl are inherited and non-virtual. These are named with | 52 // WebContentsImpl are inherited and non-virtual. These are named with |
53 // "RenderManager" so that the duplicate implementation of them will be clear. | 53 // "RenderManager" so that the duplicate implementation of them will be clear. |
54 class CONTENT_EXPORT Delegate { | 54 class CONTENT_EXPORT Delegate { |
55 public: | 55 public: |
56 // Initializes the given renderer if necessary and creates the view ID | 56 // Initializes the given renderer if necessary and creates the view ID |
57 // corresponding to this view host. If this method is not called and the | 57 // corresponding to this view host. If this method is not called and the |
58 // process is not shared, then the WebContentsImpl will act as though the | 58 // process is not shared, then the WebContentsImpl will act as though the |
59 // renderer is not running (i.e., it will render "sad tab"). This method is | 59 // renderer is not running (i.e., it will render "sad tab"). This method is |
60 // automatically called from LoadURL. | 60 // automatically called from LoadURL. |for_main_frame| indicates whether |
| 61 // this RenderViewHost is used to render a top-level frame, so the |
| 62 // appropriate RenderWidgetHostView type is used. |
61 virtual bool CreateRenderViewForRenderManager( | 63 virtual bool CreateRenderViewForRenderManager( |
62 RenderViewHost* render_view_host, | 64 RenderViewHost* render_view_host, |
63 int opener_route_id, | 65 int opener_route_id, |
64 int proxy_routing_id, | 66 int proxy_routing_id, |
65 CrossProcessFrameConnector* cross_process_frame_connector) = 0; | 67 bool for_main_frame) = 0; |
66 virtual void BeforeUnloadFiredFromRenderManager( | 68 virtual void BeforeUnloadFiredFromRenderManager( |
67 bool proceed, const base::TimeTicks& proceed_time, | 69 bool proceed, const base::TimeTicks& proceed_time, |
68 bool* proceed_to_fire_unload) = 0; | 70 bool* proceed_to_fire_unload) = 0; |
69 virtual void RenderProcessGoneFromRenderManager( | 71 virtual void RenderProcessGoneFromRenderManager( |
70 RenderViewHost* render_view_host) = 0; | 72 RenderViewHost* render_view_host) = 0; |
71 virtual void UpdateRenderViewSizeForRenderManager() = 0; | 73 virtual void UpdateRenderViewSizeForRenderManager() = 0; |
72 virtual void CancelModalDialogsForRenderManager() = 0; | 74 virtual void CancelModalDialogsForRenderManager() = 0; |
73 virtual void NotifySwappedFromRenderManager( | 75 virtual void NotifySwappedFromRenderManager( |
74 RenderViewHost* old_host, RenderViewHost* new_host) = 0; | 76 RenderViewHost* old_host, RenderViewHost* new_host) = 0; |
75 virtual NavigationControllerImpl& | 77 virtual NavigationControllerImpl& |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 374 |
373 // Sets up the necessary state for a new RenderViewHost with the given opener, | 375 // Sets up the necessary state for a new RenderViewHost with the given opener, |
374 // if necessary. It creates a RenderFrameProxy in the target renderer process | 376 // if necessary. It creates a RenderFrameProxy in the target renderer process |
375 // with the given |proxy_routing_id|, which is used to route IPC messages when | 377 // with the given |proxy_routing_id|, which is used to route IPC messages when |
376 // in swapped out state. Returns early if the RenderViewHost has already been | 378 // in swapped out state. Returns early if the RenderViewHost has already been |
377 // initialized for another RenderFrameHost. | 379 // initialized for another RenderFrameHost. |
378 // TODO(creis): opener_route_id is currently for the RenderViewHost but should | 380 // TODO(creis): opener_route_id is currently for the RenderViewHost but should |
379 // be for the RenderFrame, since frames can have openers. | 381 // be for the RenderFrame, since frames can have openers. |
380 bool InitRenderView(RenderViewHost* render_view_host, | 382 bool InitRenderView(RenderViewHost* render_view_host, |
381 int opener_route_id, | 383 int opener_route_id, |
382 int proxy_routing_id); | 384 int proxy_routing_id, |
| 385 bool for_main_frame); |
383 | 386 |
384 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this | 387 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this |
385 // doesn't require the pending render_frame_host_ pointer to be non-NULL, | 388 // doesn't require the pending render_frame_host_ pointer to be non-NULL, |
386 // since there could be Web UI switching as well. Call this for every commit. | 389 // since there could be Web UI switching as well. Call this for every commit. |
387 void CommitPending(); | 390 void CommitPending(); |
388 | 391 |
389 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown | 392 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown |
390 // frames when all the frames in a SiteInstance are confirmed to be swapped | 393 // frames when all the frames in a SiteInstance are confirmed to be swapped |
391 // out. | 394 // out. |
392 void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); | 395 void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 CrossProcessFrameConnector* cross_process_frame_connector_; | 479 CrossProcessFrameConnector* cross_process_frame_connector_; |
477 | 480 |
478 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 481 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
479 | 482 |
480 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 483 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
481 }; | 484 }; |
482 | 485 |
483 } // namespace content | 486 } // namespace content |
484 | 487 |
485 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 488 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |