OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 RenderViewHostManager( | 110 RenderViewHostManager( |
111 RenderViewHostDelegate* render_view_delegate, | 111 RenderViewHostDelegate* render_view_delegate, |
112 RenderWidgetHostDelegate* render_widget_delegate, | 112 RenderWidgetHostDelegate* render_widget_delegate, |
113 Delegate* delegate); | 113 Delegate* delegate); |
114 virtual ~RenderViewHostManager(); | 114 virtual ~RenderViewHostManager(); |
115 | 115 |
116 // For arguments, see WebContentsImpl constructor. | 116 // For arguments, see WebContentsImpl constructor. |
117 void Init(BrowserContext* browser_context, | 117 void Init(BrowserContext* browser_context, |
118 SiteInstance* site_instance, | 118 SiteInstance* site_instance, |
119 int routing_id, | 119 int routing_id, |
120 int main_frame_routing_id); | 120 int main_frame_routing_id, |
121 bool hidden); | |
121 | 122 |
122 // Returns the currently active RenderViewHost. | 123 // Returns the currently active RenderViewHost. |
123 // | 124 // |
124 // This will be non-NULL between Init() and Shutdown(). You may want to NULL | 125 // This will be non-NULL between Init() and Shutdown(). You may want to NULL |
125 // check it in many cases, however. Windows can send us messages during the | 126 // check it in many cases, however. Windows can send us messages during the |
126 // destruction process after it has been shut down. | 127 // destruction process after it has been shut down. |
127 RenderViewHostImpl* current_host() const; | 128 RenderViewHostImpl* current_host() const; |
128 | 129 |
129 // Returns the view associated with the current RenderViewHost, or NULL if | 130 // Returns the view associated with the current RenderViewHost, or NULL if |
130 // there is no current one. | 131 // there is no current one. |
(...skipping 12 matching lines...) Expand all Loading... | |
143 } | 144 } |
144 | 145 |
145 // Sets the pending Web UI for the pending navigation, ensuring that the | 146 // Sets the pending Web UI for the pending navigation, ensuring that the |
146 // bindings are appropriate for the given NavigationEntry. | 147 // bindings are appropriate for the given NavigationEntry. |
147 void SetPendingWebUI(const NavigationEntryImpl& entry); | 148 void SetPendingWebUI(const NavigationEntryImpl& entry); |
148 | 149 |
149 // Called when we want to instruct the renderer to navigate to the given | 150 // Called when we want to instruct the renderer to navigate to the given |
150 // navigation entry. It may create a new RenderViewHost or re-use an existing | 151 // navigation entry. It may create a new RenderViewHost or re-use an existing |
151 // one. The RenderViewHost to navigate will be returned. Returns NULL if one | 152 // one. The RenderViewHost to navigate will be returned. Returns NULL if one |
152 // could not be created. | 153 // could not be created. |
153 RenderViewHostImpl* Navigate(const NavigationEntryImpl& entry); | 154 RenderViewHostImpl* Navigate(const NavigationEntryImpl& entry, bool hidden); |
Charlie Reis
2013/08/19 22:18:02
I'd really like to avoid passing more parameters h
jamesr
2013/08/19 23:50:39
OK, done. I have to call it in two places - when
| |
154 | 155 |
155 // Instructs the various live views to stop. Called when the user directed the | 156 // Instructs the various live views to stop. Called when the user directed the |
156 // page to stop loading. | 157 // page to stop loading. |
157 void Stop(); | 158 void Stop(); |
158 | 159 |
159 // Notifies the regular and pending RenderViewHosts that a load is or is not | 160 // Notifies the regular and pending RenderViewHosts that a load is or is not |
160 // happening. Even though the message is only for one of them, we don't know | 161 // happening. Even though the message is only for one of them, we don't know |
161 // which one so we tell both. | 162 // which one so we tell both. |
162 void SetIsLoading(bool is_loading); | 163 void SetIsLoading(bool is_loading); |
163 | 164 |
(...skipping 10 matching lines...) Expand all Loading... | |
174 void DidNavigateMainFrame(RenderViewHost* render_view_host); | 175 void DidNavigateMainFrame(RenderViewHost* render_view_host); |
175 | 176 |
176 // Called when a renderer sets its opener to null. | 177 // Called when a renderer sets its opener to null. |
177 void DidDisownOpener(RenderViewHost* render_view_host); | 178 void DidDisownOpener(RenderViewHost* render_view_host); |
178 | 179 |
179 // Helper method to create a RenderViewHost. If |swapped_out| is true, it | 180 // Helper method to create a RenderViewHost. If |swapped_out| is true, it |
180 // will be initially placed on the swapped out hosts list. Otherwise, it | 181 // will be initially placed on the swapped out hosts list. Otherwise, it |
181 // will be used for a pending cross-site navigation. | 182 // will be used for a pending cross-site navigation. |
182 int CreateRenderView(SiteInstance* instance, | 183 int CreateRenderView(SiteInstance* instance, |
183 int opener_route_id, | 184 int opener_route_id, |
184 bool swapped_out); | 185 bool swapped_out, |
186 bool hidden); | |
185 | 187 |
186 // Called when a provisional load on the given renderer is aborted. | 188 // Called when a provisional load on the given renderer is aborted. |
187 void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host); | 189 void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host); |
188 | 190 |
189 // Sets the passed passed interstitial as the currently showing interstitial. | 191 // Sets the passed passed interstitial as the currently showing interstitial. |
190 // |interstitial_page| should be non NULL (use the remove_interstitial_page | 192 // |interstitial_page| should be non NULL (use the remove_interstitial_page |
191 // method to unset the interstitial) and no interstitial page should be set | 193 // method to unset the interstitial) and no interstitial page should be set |
192 // when there is already a non NULL interstitial page set. | 194 // when there is already a non NULL interstitial page set. |
193 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { | 195 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { |
194 DCHECK(!interstitial_page_ && interstitial_page); | 196 DCHECK(!interstitial_page_ && interstitial_page); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 | 285 |
284 // Shutdown all RenderViewHosts in a SiteInstance. This is called | 286 // Shutdown all RenderViewHosts in a SiteInstance. This is called |
285 // to shutdown views when all the views in a SiteInstance are | 287 // to shutdown views when all the views in a SiteInstance are |
286 // confirmed to be swapped out. | 288 // confirmed to be swapped out. |
287 void ShutdownRenderViewHostsInSiteInstance(int32 site_instance_id); | 289 void ShutdownRenderViewHostsInSiteInstance(int32 site_instance_id); |
288 | 290 |
289 // Helper method to terminate the pending RenderViewHost. | 291 // Helper method to terminate the pending RenderViewHost. |
290 void CancelPending(); | 292 void CancelPending(); |
291 | 293 |
292 RenderViewHostImpl* UpdateRendererStateForNavigate( | 294 RenderViewHostImpl* UpdateRendererStateForNavigate( |
293 const NavigationEntryImpl& entry); | 295 const NavigationEntryImpl& entry, bool hidden); |
sky
2013/08/19 20:21:47
nit: when you wrap one param per line.
| |
294 | 296 |
295 // Called when a renderer process is starting to close. We should not | 297 // Called when a renderer process is starting to close. We should not |
296 // schedule new navigations in its swapped out RenderViewHosts after this. | 298 // schedule new navigations in its swapped out RenderViewHosts after this. |
297 void RendererProcessClosing(RenderProcessHost* render_process_host); | 299 void RendererProcessClosing(RenderProcessHost* render_process_host); |
298 | 300 |
299 // Our delegate, not owned by us. Guaranteed non-NULL. | 301 // Our delegate, not owned by us. Guaranteed non-NULL. |
300 Delegate* delegate_; | 302 Delegate* delegate_; |
301 | 303 |
302 // Whether a navigation requiring different RenderView's is pending. This is | 304 // Whether a navigation requiring different RenderView's is pending. This is |
303 // either cross-site request is (in the new process model), or when required | 305 // either cross-site request is (in the new process model), or when required |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 InterstitialPageImpl* interstitial_page_; | 349 InterstitialPageImpl* interstitial_page_; |
348 | 350 |
349 NotificationRegistrar registrar_; | 351 NotificationRegistrar registrar_; |
350 | 352 |
351 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); | 353 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); |
352 }; | 354 }; |
353 | 355 |
354 } // namespace content | 356 } // namespace content |
355 | 357 |
356 #endif // CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 358 #endif // CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
OLD | NEW |