OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 6 #define CHROME_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/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
11 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 12 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
12 #include "chrome/common/notification_registrar.h" | 13 #include "chrome/common/notification_registrar.h" |
13 #include "chrome/common/notification_observer.h" | 14 #include "chrome/common/notification_observer.h" |
14 | 15 |
15 class DOMUI; | 16 class DOMUI; |
16 class InterstitialPage; | 17 class InterstitialPage; |
17 class NavigationController; | 18 class NavigationController; |
18 class NavigationEntry; | 19 class NavigationEntry; |
19 class Profile; | 20 class Profile; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // privileges from the originating renderer. | 139 // privileges from the originating renderer. |
139 void SetDOMUIPostCommit(DOMUI* dom_ui); | 140 void SetDOMUIPostCommit(DOMUI* dom_ui); |
140 | 141 |
141 // Called when a provisional load on the given renderer is aborted. | 142 // Called when a provisional load on the given renderer is aborted. |
142 void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host); | 143 void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host); |
143 | 144 |
144 // Sets the passed passed interstitial as the currently showing interstitial. | 145 // Sets the passed passed interstitial as the currently showing interstitial. |
145 // |interstitial_page| should be non NULL (use the remove_interstitial_page | 146 // |interstitial_page| should be non NULL (use the remove_interstitial_page |
146 // method to unset the interstitial) and no interstitial page should be set | 147 // method to unset the interstitial) and no interstitial page should be set |
147 // when there is already a non NULL interstitial page set. | 148 // when there is already a non NULL interstitial page set. |
148 void set_interstitial_page(InterstitialPage* interstitial_page); | 149 void set_interstitial_page(InterstitialPage* interstitial_page) { |
| 150 DCHECK(!interstitial_page_ && interstitial_page); |
| 151 interstitial_page_ = interstitial_page; |
| 152 } |
149 | 153 |
150 // Unsets the currently showing interstitial. | 154 // Unsets the currently showing interstitial. |
151 void remove_interstitial_page(); | 155 void remove_interstitial_page() { |
| 156 DCHECK(interstitial_page_); |
| 157 interstitial_page_ = NULL; |
| 158 } |
152 | 159 |
153 // Returns the currently showing interstitial, NULL if no interstitial is | 160 // Returns the currently showing interstitial, NULL if no interstitial is |
154 // showing. | 161 // showing. |
155 InterstitialPage* interstitial_page() const { | 162 InterstitialPage* interstitial_page() const { |
156 return interstitial_page_; | 163 return interstitial_page_; |
157 } | 164 } |
158 | 165 |
159 // RenderViewHostDelegate::RendererManagement implementation. | 166 // RenderViewHostDelegate::RendererManagement implementation. |
160 virtual void ShouldClosePage(bool for_cross_site_transition, bool proceed); | 167 virtual void ShouldClosePage(bool for_cross_site_transition, bool proceed); |
161 virtual void OnCrossSiteResponse(int new_render_process_host_id, | 168 virtual void OnCrossSiteResponse(int new_render_process_host_id, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 }; | 257 }; |
251 | 258 |
252 // The "details" for a NOTIFY_RENDER_VIEW_HOST_CHANGED notification. The old | 259 // The "details" for a NOTIFY_RENDER_VIEW_HOST_CHANGED notification. The old |
253 // host can be NULL when the first RenderViewHost is set. | 260 // host can be NULL when the first RenderViewHost is set. |
254 struct RenderViewHostSwitchedDetails { | 261 struct RenderViewHostSwitchedDetails { |
255 RenderViewHost* old_host; | 262 RenderViewHost* old_host; |
256 RenderViewHost* new_host; | 263 RenderViewHost* new_host; |
257 }; | 264 }; |
258 | 265 |
259 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ | 266 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ |
OLD | NEW |