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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class RenderWidgetHostView; | 22 class RenderWidgetHostView; |
23 class WebUI; | 23 class WebUI; |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class BrowserContext; | 26 class BrowserContext; |
27 } | 27 } |
28 | 28 |
29 // Manages RenderViewHosts for a TabContents. Normally there is only one and | 29 // Manages RenderViewHosts for a TabContents. Normally there is only one and |
30 // it is easy to do. But we can also have transitions of processes (and hence | 30 // it is easy to do. But we can also have transitions of processes (and hence |
31 // RenderViewHosts) that can get complex. | 31 // RenderViewHosts) that can get complex. |
32 class RenderViewHostManager | 32 class CONTENT_EXPORT RenderViewHostManager |
33 : public RenderViewHostDelegate::RendererManagement, | 33 : public RenderViewHostDelegate::RendererManagement, |
34 public NotificationObserver { | 34 public NotificationObserver { |
35 public: | 35 public: |
36 // Functions implemented by our owner that we need. | 36 // Functions implemented by our owner that we need. |
37 // | 37 // |
38 // TODO(brettw) Clean this up! These are all the functions in TabContents that | 38 // TODO(brettw) Clean this up! These are all the functions in TabContents that |
39 // are required to run this class. The design should probably be better such | 39 // are required to run this class. The design should probably be better such |
40 // that these are more clear. | 40 // that these are more clear. |
41 // | 41 // |
42 // There is additional complexity that some of the functions we need in | 42 // There is additional complexity that some of the functions we need in |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // | 99 // |
100 // This will be non-NULL between Init() and Shutdown(). You may want to NULL | 100 // This will be non-NULL between Init() and Shutdown(). You may want to NULL |
101 // check it in many cases, however. Windows can send us messages during the | 101 // check it in many cases, however. Windows can send us messages during the |
102 // destruction process after it has been shut down. | 102 // destruction process after it has been shut down. |
103 RenderViewHost* current_host() const { | 103 RenderViewHost* current_host() const { |
104 return render_view_host_; | 104 return render_view_host_; |
105 } | 105 } |
106 | 106 |
107 // Returns the view associated with the current RenderViewHost, or NULL if | 107 // Returns the view associated with the current RenderViewHost, or NULL if |
108 // there is no current one. | 108 // there is no current one. |
109 CONTENT_EXPORT RenderWidgetHostView* GetRenderWidgetHostView() const; | 109 RenderWidgetHostView* GetRenderWidgetHostView() const; |
110 | 110 |
111 // Returns the pending render view host, or NULL if there is no pending one. | 111 // Returns the pending render view host, or NULL if there is no pending one. |
112 RenderViewHost* pending_render_view_host() const { | 112 RenderViewHost* pending_render_view_host() const { |
113 return pending_render_view_host_; | 113 return pending_render_view_host_; |
114 } | 114 } |
115 | 115 |
116 // Returns the current committed Web UI or NULL if none applies. | 116 // Returns the current committed Web UI or NULL if none applies. |
117 WebUI* web_ui() const { return web_ui_.get(); } | 117 WebUI* web_ui() const { return web_ui_.get(); } |
118 | 118 |
119 // Returns the Web UI for the pending navigation, or NULL of none applies. | 119 // Returns the Web UI for the pending navigation, or NULL of none applies. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 }; | 287 }; |
288 | 288 |
289 // The "details" for a NOTIFY_RENDER_VIEW_HOST_CHANGED notification. The old | 289 // The "details" for a NOTIFY_RENDER_VIEW_HOST_CHANGED notification. The old |
290 // host can be NULL when the first RenderViewHost is set. | 290 // host can be NULL when the first RenderViewHost is set. |
291 struct RenderViewHostSwitchedDetails { | 291 struct RenderViewHostSwitchedDetails { |
292 RenderViewHost* old_host; | 292 RenderViewHost* old_host; |
293 RenderViewHost* new_host; | 293 RenderViewHost* new_host; |
294 }; | 294 }; |
295 | 295 |
296 #endif // CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 296 #endif // CONTENT_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
OLD | NEW |