| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // interstitial's "failed" message (as a result of the cancel) when we're on | 256 // interstitial's "failed" message (as a result of the cancel) when we're on |
| 257 // the second one. We can't tell this apart, so we think we're tearing down | 257 // the second one. We can't tell this apart, so we think we're tearing down |
| 258 // the current page which will cause a crash later on. | 258 // the current page which will cause a crash later on. |
| 259 // | 259 // |
| 260 // http://code.google.com/p/chromium/issues/detail?id=2855 | 260 // http://code.google.com/p/chromium/issues/detail?id=2855 |
| 261 // Because this will not tear down the interstitial properly, if "back" is | 261 // Because this will not tear down the interstitial properly, if "back" is |
| 262 // back to another tab type, the interstitial will still be somewhat alive | 262 // back to another tab type, the interstitial will still be somewhat alive |
| 263 // in the previous tab type. If you navigate somewhere that activates the | 263 // in the previous tab type. If you navigate somewhere that activates the |
| 264 // tab with the interstitial again, you'll see a flash before the new load | 264 // tab with the interstitial again, you'll see a flash before the new load |
| 265 // commits of the interstitial page. | 265 // commits of the interstitial page. |
| 266 FrameTreeNode* root = | 266 if (delegate_ && delegate_->ShowingInterstitialPage()) { |
| 267 render_frame_host->frame_tree_node()->frame_tree()->root(); | |
| 268 if (root->render_manager()->interstitial_page() != NULL) { | |
| 269 LOG(WARNING) << "Discarding message during interstitial."; | 267 LOG(WARNING) << "Discarding message during interstitial."; |
| 270 return; | 268 return; |
| 271 } | 269 } |
| 272 | 270 |
| 273 // We used to cancel the pending renderer here for cross-site downloads. | 271 // We used to cancel the pending renderer here for cross-site downloads. |
| 274 // However, it's not safe to do that because the download logic repeatedly | 272 // However, it's not safe to do that because the download logic repeatedly |
| 275 // looks for this WebContents based on a render ID. Instead, we just | 273 // looks for this WebContents based on a render ID. Instead, we just |
| 276 // leave the pending renderer around until the next navigation event | 274 // leave the pending renderer around until the next navigation event |
| 277 // (Navigate, DidNavigate, etc), which will clean it up properly. | 275 // (Navigate, DidNavigate, etc), which will clean it up properly. |
| 278 // | 276 // |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 if (navigation_handle) | 1296 if (navigation_handle) |
| 1299 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1297 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
| 1300 | 1298 |
| 1301 controller_->SetPendingEntry(std::move(entry)); | 1299 controller_->SetPendingEntry(std::move(entry)); |
| 1302 if (delegate_) | 1300 if (delegate_) |
| 1303 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1301 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1304 } | 1302 } |
| 1305 } | 1303 } |
| 1306 | 1304 |
| 1307 } // namespace content | 1305 } // namespace content |
| OLD | NEW |