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