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. |main_frame| indicates whether this |
Charlie Reis
2014/05/16 17:04:06
This comment doesn't quite make sense, because a R
nasko
2014/05/16 17:26:02
At this point in time, I don't think RVH can be re
| |
61 // RenderViewHost is used to render a top-level frame or subframe, so the | |
Charlie Reis
2014/05/16 17:04:06
nit: drop "or subframe"
nasko
2014/05/16 17:26:02
Done.
| |
62 // appropriate RenderWidgetHostView type is used. | |
61 // | 63 // |
62 // If you are attaching to an already-existing RenderView, you should call | 64 // If you are attaching to an already-existing RenderView, you should call |
63 // InitWithExistingID. | 65 // InitWithExistingID. |
64 virtual bool CreateRenderViewForRenderManager( | 66 virtual bool CreateRenderViewForRenderManager( |
65 RenderViewHost* render_view_host, | 67 RenderViewHost* render_view_host, |
66 int opener_route_id, | 68 int opener_route_id, |
67 CrossProcessFrameConnector* cross_process_frame_connector) = 0; | 69 bool main_frame) = 0; |
Charlie Reis
2014/05/16 17:04:06
nit: for_main_frame
(for the same reason mentioned
nasko
2014/05/16 17:26:02
Done.
| |
68 virtual void BeforeUnloadFiredFromRenderManager( | 70 virtual void BeforeUnloadFiredFromRenderManager( |
69 bool proceed, const base::TimeTicks& proceed_time, | 71 bool proceed, const base::TimeTicks& proceed_time, |
70 bool* proceed_to_fire_unload) = 0; | 72 bool* proceed_to_fire_unload) = 0; |
71 virtual void RenderProcessGoneFromRenderManager( | 73 virtual void RenderProcessGoneFromRenderManager( |
72 RenderViewHost* render_view_host) = 0; | 74 RenderViewHost* render_view_host) = 0; |
73 virtual void UpdateRenderViewSizeForRenderManager() = 0; | 75 virtual void UpdateRenderViewSizeForRenderManager() = 0; |
74 virtual void CancelModalDialogsForRenderManager() = 0; | 76 virtual void CancelModalDialogsForRenderManager() = 0; |
75 virtual void NotifySwappedFromRenderManager( | 77 virtual void NotifySwappedFromRenderManager( |
76 RenderViewHost* old_host, RenderViewHost* new_host) = 0; | 78 RenderViewHost* old_host, RenderViewHost* new_host) = 0; |
77 virtual NavigationControllerImpl& | 79 virtual NavigationControllerImpl& |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 int view_routing_id, | 372 int view_routing_id, |
371 int frame_routing_id, | 373 int frame_routing_id, |
372 bool swapped_out, | 374 bool swapped_out, |
373 bool hidden); | 375 bool hidden); |
374 | 376 |
375 // Sets up the necessary state for a new RenderViewHost with the given opener, | 377 // Sets up the necessary state for a new RenderViewHost with the given opener, |
376 // if necessary. Returns early if the RenderViewHost has already been | 378 // if necessary. 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, int opener_route_id); | 382 bool InitRenderView(RenderViewHost* render_view_host, |
383 int opener_route_id, | |
384 bool main_frame); | |
Charlie Reis
2014/05/16 17:04:06
nit: for_main_frame
nasko
2014/05/16 17:26:02
Done.
| |
381 | 385 |
382 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this | 386 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this |
383 // doesn't require the pending render_frame_host_ pointer to be non-NULL, | 387 // doesn't require the pending render_frame_host_ pointer to be non-NULL, |
384 // since there could be Web UI switching as well. Call this for every commit. | 388 // since there could be Web UI switching as well. Call this for every commit. |
385 void CommitPending(); | 389 void CommitPending(); |
386 | 390 |
387 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown | 391 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown |
388 // frames when all the frames in a SiteInstance are confirmed to be swapped | 392 // frames when all the frames in a SiteInstance are confirmed to be swapped |
389 // out. | 393 // out. |
390 void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); | 394 void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 CrossProcessFrameConnector* cross_process_frame_connector_; | 478 CrossProcessFrameConnector* cross_process_frame_connector_; |
475 | 479 |
476 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 480 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
477 | 481 |
478 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 482 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
479 }; | 483 }; |
480 | 484 |
481 } // namespace content | 485 } // namespace content |
482 | 486 |
483 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 487 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |