| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // A navigation in the original page has taken place. Cancel the pending | 180 // A navigation in the original page has taken place. Cancel the pending |
| 181 // one. | 181 // one. |
| 182 CancelPending(); | 182 CancelPending(); |
| 183 cross_navigation_pending_ = false; | 183 cross_navigation_pending_ = false; |
| 184 } else { | 184 } else { |
| 185 // No one else should be sending us DidNavigate in this state. | 185 // No one else should be sending us DidNavigate in this state. |
| 186 DCHECK(false); | 186 DCHECK(false); |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 void RenderViewHostManager::SetDOMUIPostCommit(DOMUI* dom_ui) { |
| 191 DCHECK(!dom_ui_.get()); |
| 192 dom_ui_.reset(dom_ui); |
| 193 } |
| 194 |
| 190 void RenderViewHostManager::RendererAbortedProvisionalLoad( | 195 void RenderViewHostManager::RendererAbortedProvisionalLoad( |
| 191 RenderViewHost* render_view_host) { | 196 RenderViewHost* render_view_host) { |
| 192 // We used to cancel the pending renderer here for cross-site downloads. | 197 // We used to cancel the pending renderer here for cross-site downloads. |
| 193 // However, it's not safe to do that because the download logic repeatedly | 198 // However, it's not safe to do that because the download logic repeatedly |
| 194 // looks for this TabContents based on a render view ID. Instead, we just | 199 // looks for this TabContents based on a render view ID. Instead, we just |
| 195 // leave the pending renderer around until the next navigation event | 200 // leave the pending renderer around until the next navigation event |
| 196 // (Navigate, DidNavigate, etc), which will clean it up properly. | 201 // (Navigate, DidNavigate, etc), which will clean it up properly. |
| 197 // TODO(creis): All of this will go away when we move the cross-site logic | 202 // TODO(creis): All of this will go away when we move the cross-site logic |
| 198 // to ResourceDispatcherHost, so that we intercept responses rather than | 203 // to ResourceDispatcherHost, so that we intercept responses rather than |
| 199 // navigation events. (That's necessary to support onunload anyway.) Once | 204 // navigation events. (That's necessary to support onunload anyway.) Once |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 return render_view_host_; | 594 return render_view_host_; |
| 590 } | 595 } |
| 591 | 596 |
| 592 void RenderViewHostManager::CancelPending() { | 597 void RenderViewHostManager::CancelPending() { |
| 593 RenderViewHost* pending_render_view_host = pending_render_view_host_; | 598 RenderViewHost* pending_render_view_host = pending_render_view_host_; |
| 594 pending_render_view_host_ = NULL; | 599 pending_render_view_host_ = NULL; |
| 595 pending_render_view_host->Shutdown(); | 600 pending_render_view_host->Shutdown(); |
| 596 | 601 |
| 597 pending_dom_ui_.reset(); | 602 pending_dom_ui_.reset(); |
| 598 } | 603 } |
| OLD | NEW |