Index: content/browser/frame_host/navigation_controller_impl.cc |
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc |
index 1f07ec664e0b2f0f212e746e2fb5d89d9d80db42..3ece628e668dc4daff0f6a4af65d659d5403cadb 100644 |
--- a/content/browser/frame_host/navigation_controller_impl.cc |
+++ b/content/browser/frame_host/navigation_controller_impl.cc |
@@ -1880,10 +1880,15 @@ void NavigationControllerImpl::NavigateToPendingEntry(ReloadType reload_type) { |
pending_entry_->GetTransitionType() & ui::PAGE_TRANSITION_FORWARD_BACK) { |
delegate_->Stop(); |
- // If an interstitial page is showing, we want to close it to get back |
- // to what was showing before. |
- if (delegate_->GetInterstitialPage()) |
- delegate_->GetInterstitialPage()->DontProceed(); |
+ // If an interstitial page is showing, we want to close it to get back to |
+ // what was showing before. There are two ways to get the interstitial page |
+ // given a WebContents, but WebContents::GetInterstitialPage might return |
+ // null if the interstitial was shown but not yet visible while |
Charlie Reis
2017/06/22 16:19:38
nit: s/shown/created/, perhaps?
Avi (use Gerrit)
2017/06/22 18:08:51
I'm talking about the range in which WebContents::
Charlie Reis
2017/06/22 21:06:00
Ok. Can you rephrase to say "if the interstitial'
Avi (use Gerrit)
2017/06/22 21:46:42
I rewrote it a few times, and I'm now much happier
|
+ // InterstitialPage::GetInterstitialPage will return such an interstitial. |
+ InterstitialPage* interstitial = |
+ InterstitialPage::GetInterstitialPage(GetWebContents()); |
+ if (interstitial) |
+ interstitial->DontProceed(); |
DiscardNonCommittedEntries(); |
return; |