| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/tab_contents/render_view_host_manager.h" | 5 #include "chrome/browser/tab_contents/render_view_host_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/dom_ui/dom_ui.h" | 9 #include "chrome/browser/dom_ui/dom_ui.h" |
| 10 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 10 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // looks for this TabContents based on a render view ID. Instead, we just | 198 // looks for this TabContents based on a render view ID. Instead, we just |
| 199 // leave the pending renderer around until the next navigation event | 199 // leave the pending renderer around until the next navigation event |
| 200 // (Navigate, DidNavigate, etc), which will clean it up properly. | 200 // (Navigate, DidNavigate, etc), which will clean it up properly. |
| 201 // TODO(creis): All of this will go away when we move the cross-site logic | 201 // TODO(creis): All of this will go away when we move the cross-site logic |
| 202 // to ResourceDispatcherHost, so that we intercept responses rather than | 202 // to ResourceDispatcherHost, so that we intercept responses rather than |
| 203 // navigation events. (That's necessary to support onunload anyway.) Once | 203 // navigation events. (That's necessary to support onunload anyway.) Once |
| 204 // we've made that change, we won't create a pending renderer until we know | 204 // we've made that change, we won't create a pending renderer until we know |
| 205 // the response is not a download. | 205 // the response is not a download. |
| 206 } | 206 } |
| 207 | 207 |
| 208 void RenderViewHostManager::OnJavaScriptMessageBoxClosed( | |
| 209 IPC::Message* reply_msg, | |
| 210 bool success, | |
| 211 const std::wstring& prompt) { | |
| 212 render_view_host_->JavaScriptMessageBoxClosed(reply_msg, success, prompt); | |
| 213 } | |
| 214 | |
| 215 void RenderViewHostManager::ShouldClosePage(bool for_cross_site_transition, | 208 void RenderViewHostManager::ShouldClosePage(bool for_cross_site_transition, |
| 216 bool proceed) { | 209 bool proceed) { |
| 217 if (for_cross_site_transition) { | 210 if (for_cross_site_transition) { |
| 218 if (proceed) { | 211 if (proceed) { |
| 219 // Ok to unload the current page, so proceed with the cross-site | 212 // Ok to unload the current page, so proceed with the cross-site |
| 220 // navigation. Note that if navigations are not currently suspended, it | 213 // navigation. Note that if navigations are not currently suspended, it |
| 221 // might be because the renderer was deemed unresponsive and this call was | 214 // might be because the renderer was deemed unresponsive and this call was |
| 222 // already made by ShouldCloseTabOnUnresponsiveRenderer. In that case, it | 215 // already made by ShouldCloseTabOnUnresponsiveRenderer. In that case, it |
| 223 // is ok to do nothing here. | 216 // is ok to do nothing here. |
| 224 if (pending_render_view_host_ && | 217 if (pending_render_view_host_ && |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 return render_view_host_; | 582 return render_view_host_; |
| 590 } | 583 } |
| 591 | 584 |
| 592 void RenderViewHostManager::CancelPending() { | 585 void RenderViewHostManager::CancelPending() { |
| 593 RenderViewHost* pending_render_view_host = pending_render_view_host_; | 586 RenderViewHost* pending_render_view_host = pending_render_view_host_; |
| 594 pending_render_view_host_ = NULL; | 587 pending_render_view_host_ = NULL; |
| 595 pending_render_view_host->Shutdown(); | 588 pending_render_view_host->Shutdown(); |
| 596 | 589 |
| 597 pending_dom_ui_.reset(); | 590 pending_dom_ui_.reset(); |
| 598 } | 591 } |
| OLD | NEW |