| 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_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/browser/site_instance.h" | 12 #include "content/browser/site_instance_impl.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
| 15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 16 #include "content/public/browser/render_view_host_delegate.h" | 16 #include "content/public/browser/render_view_host_delegate.h" |
| 17 | 17 |
| 18 class InterstitialPage; | 18 class InterstitialPage; |
| 19 class NavigationControllerImpl; | 19 class NavigationControllerImpl; |
| 20 class RenderViewHost; | 20 class RenderViewHost; |
| 21 class RenderWidgetHostView; | 21 class RenderWidgetHostView; |
| 22 class WebUIImpl; | 22 class WebUIImpl; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // They must outlive this class. The RenderViewHostDelegate is what will be | 94 // They must outlive this class. The RenderViewHostDelegate is what will be |
| 95 // installed into all RenderViewHosts that are created. | 95 // installed into all RenderViewHosts that are created. |
| 96 // | 96 // |
| 97 // You must call Init() before using this class. | 97 // You must call Init() before using this class. |
| 98 RenderViewHostManager(content::RenderViewHostDelegate* render_view_delegate, | 98 RenderViewHostManager(content::RenderViewHostDelegate* render_view_delegate, |
| 99 Delegate* delegate); | 99 Delegate* delegate); |
| 100 virtual ~RenderViewHostManager(); | 100 virtual ~RenderViewHostManager(); |
| 101 | 101 |
| 102 // For arguments, see TabContents constructor. | 102 // For arguments, see TabContents constructor. |
| 103 void Init(content::BrowserContext* browser_context, | 103 void Init(content::BrowserContext* browser_context, |
| 104 SiteInstance* site_instance, | 104 content::SiteInstance* site_instance, |
| 105 int routing_id); | 105 int routing_id); |
| 106 | 106 |
| 107 // Returns the currently active RenderViewHost. | 107 // Returns the currently active RenderViewHost. |
| 108 // | 108 // |
| 109 // This will be non-NULL between Init() and Shutdown(). You may want to NULL | 109 // This will be non-NULL between Init() and Shutdown(). You may want to NULL |
| 110 // check it in many cases, however. Windows can send us messages during the | 110 // check it in many cases, however. Windows can send us messages during the |
| 111 // destruction process after it has been shut down. | 111 // destruction process after it has been shut down. |
| 112 RenderViewHost* current_host() const { | 112 RenderViewHost* current_host() const { |
| 113 return render_view_host_; | 113 return render_view_host_; |
| 114 } | 114 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // RenderProcessHosts) even if the site instance would otherwise be the same. | 213 // RenderProcessHosts) even if the site instance would otherwise be the same. |
| 214 // As part of this, we'll also force new SiteInstances and BrowsingInstances. | 214 // As part of this, we'll also force new SiteInstances and BrowsingInstances. |
| 215 // Either of the entries may be NULL. | 215 // Either of the entries may be NULL. |
| 216 bool ShouldSwapProcessesForNavigation( | 216 bool ShouldSwapProcessesForNavigation( |
| 217 const content::NavigationEntry* cur_entry, | 217 const content::NavigationEntry* cur_entry, |
| 218 const content::NavigationEntryImpl* new_entry) const; | 218 const content::NavigationEntryImpl* new_entry) const; |
| 219 | 219 |
| 220 // Returns an appropriate SiteInstance object for the given NavigationEntry, | 220 // Returns an appropriate SiteInstance object for the given NavigationEntry, |
| 221 // possibly reusing the current SiteInstance. | 221 // possibly reusing the current SiteInstance. |
| 222 // Never called if --process-per-tab is used. | 222 // Never called if --process-per-tab is used. |
| 223 SiteInstance* GetSiteInstanceForEntry( | 223 content::SiteInstance* GetSiteInstanceForEntry( |
| 224 const content::NavigationEntryImpl& entry, | 224 const content::NavigationEntryImpl& entry, |
| 225 SiteInstance* curr_instance); | 225 content::SiteInstance* curr_instance); |
| 226 | 226 |
| 227 // Helper method to create a pending RenderViewHost for a cross-site | 227 // Helper method to create a pending RenderViewHost for a cross-site |
| 228 // navigation. | 228 // navigation. |
| 229 bool CreatePendingRenderView(const content::NavigationEntryImpl& entry, | 229 bool CreatePendingRenderView(const content::NavigationEntryImpl& entry, |
| 230 SiteInstance* instance); | 230 content::SiteInstance* instance); |
| 231 | 231 |
| 232 // Sets up the necessary state for a new RenderViewHost navigating to the | 232 // Sets up the necessary state for a new RenderViewHost navigating to the |
| 233 // given entry. | 233 // given entry. |
| 234 bool InitRenderView(RenderViewHost* render_view_host, | 234 bool InitRenderView(RenderViewHost* render_view_host, |
| 235 const content::NavigationEntryImpl& entry); | 235 const content::NavigationEntryImpl& entry); |
| 236 | 236 |
| 237 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this | 237 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this |
| 238 // doesn't require the pending render_view_host_ pointer to be non-NULL, since | 238 // doesn't require the pending render_view_host_ pointer to be non-NULL, since |
| 239 // there could be Web UI switching as well. Call this for every commit. | 239 // there could be Web UI switching as well. Call this for every commit. |
| 240 void CommitPending(); | 240 void CommitPending(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // The intersitial page currently shown if any, not own by this class | 286 // The intersitial page currently shown if any, not own by this class |
| 287 // (the InterstitialPage is self-owned, it deletes itself when hidden). | 287 // (the InterstitialPage is self-owned, it deletes itself when hidden). |
| 288 InterstitialPage* interstitial_page_; | 288 InterstitialPage* interstitial_page_; |
| 289 | 289 |
| 290 content::NotificationRegistrar registrar_; | 290 content::NotificationRegistrar registrar_; |
| 291 | 291 |
| 292 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); | 292 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 #endif // CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 295 #endif // CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
| OLD | NEW |