| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer_host/render_view_host_delegate.h" | 12 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 13 #include "content/common/notification_observer.h" | 13 #include "content/common/notification_observer.h" |
| 14 #include "content/common/notification_registrar.h" | 14 #include "content/common/notification_registrar.h" |
| 15 #include "content/browser/site_instance.h" | 15 #include "content/browser/site_instance.h" |
| 16 | 16 |
| 17 class WebUI; | |
| 18 class InterstitialPage; | 17 class InterstitialPage; |
| 19 class NavigationController; | 18 class NavigationController; |
| 20 class NavigationEntry; | 19 class NavigationEntry; |
| 21 class Profile; | 20 class RenderViewHost; |
| 22 class RenderWidgetHostView; | 21 class RenderWidgetHostView; |
| 23 class RenderViewHost; | 22 class WebUI; |
| 23 |
| 24 namespace content { |
| 25 class BrowserContext; |
| 26 } |
| 24 | 27 |
| 25 // Manages RenderViewHosts for a TabContents. Normally there is only one and | 28 // Manages RenderViewHosts for a TabContents. Normally there is only one and |
| 26 // it is easy to do. But we can also have transitions of processes (and hence | 29 // it is easy to do. But we can also have transitions of processes (and hence |
| 27 // RenderViewHosts) that can get complex. | 30 // RenderViewHosts) that can get complex. |
| 28 class RenderViewHostManager | 31 class RenderViewHostManager |
| 29 : public RenderViewHostDelegate::RendererManagement, | 32 : public RenderViewHostDelegate::RendererManagement, |
| 30 public NotificationObserver { | 33 public NotificationObserver { |
| 31 public: | 34 public: |
| 32 // Functions implemented by our owner that we need. | 35 // Functions implemented by our owner that we need. |
| 33 // | 36 // |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Both delegate pointers must be non-NULL and are not owned by this class. | 83 // Both delegate pointers must be non-NULL and are not owned by this class. |
| 81 // They must outlive this class. The RenderViewHostDelegate is what will be | 84 // They must outlive this class. The RenderViewHostDelegate is what will be |
| 82 // installed into all RenderViewHosts that are created. | 85 // installed into all RenderViewHosts that are created. |
| 83 // | 86 // |
| 84 // You must call Init() before using this class. | 87 // You must call Init() before using this class. |
| 85 RenderViewHostManager(RenderViewHostDelegate* render_view_delegate, | 88 RenderViewHostManager(RenderViewHostDelegate* render_view_delegate, |
| 86 Delegate* delegate); | 89 Delegate* delegate); |
| 87 virtual ~RenderViewHostManager(); | 90 virtual ~RenderViewHostManager(); |
| 88 | 91 |
| 89 // For arguments, see TabContents constructor. | 92 // For arguments, see TabContents constructor. |
| 90 void Init(Profile* profile, | 93 void Init(content::BrowserContext* context, |
| 91 SiteInstance* site_instance, | 94 SiteInstance* site_instance, |
| 92 int routing_id); | 95 int routing_id); |
| 93 | 96 |
| 94 // Returns the currently actuive RenderViewHost. | 97 // Returns the currently active RenderViewHost. |
| 95 // | 98 // |
| 96 // This will be non-NULL between Init() and Shutdown(). You may want to NULL | 99 // This will be non-NULL between Init() and Shutdown(). You may want to NULL |
| 97 // check it in many cases, however. Windows can send us messages during the | 100 // check it in many cases, however. Windows can send us messages during the |
| 98 // destruction process after it has been shut down. | 101 // destruction process after it has been shut down. |
| 99 RenderViewHost* current_host() const { | 102 RenderViewHost* current_host() const { |
| 100 return render_view_host_; | 103 return render_view_host_; |
| 101 } | 104 } |
| 102 | 105 |
| 103 // Returns the view associated with the current RenderViewHost, or NULL if | 106 // Returns the view associated with the current RenderViewHost, or NULL if |
| 104 // there is no current one. | 107 // there is no current one. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 }; | 286 }; |
| 284 | 287 |
| 285 // The "details" for a NOTIFY_RENDER_VIEW_HOST_CHANGED notification. The old | 288 // The "details" for a NOTIFY_RENDER_VIEW_HOST_CHANGED notification. The old |
| 286 // host can be NULL when the first RenderViewHost is set. | 289 // host can be NULL when the first RenderViewHost is set. |
| 287 struct RenderViewHostSwitchedDetails { | 290 struct RenderViewHostSwitchedDetails { |
| 288 RenderViewHost* old_host; | 291 RenderViewHost* old_host; |
| 289 RenderViewHost* new_host; | 292 RenderViewHost* new_host; |
| 290 }; | 293 }; |
| 291 | 294 |
| 292 #endif // CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 295 #endif // CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
| OLD | NEW |