Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 5c51c153a666b65d41ff53407549e563c1b06a63..9c42e7c231561d0b913bac0799305fab369e1446 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1785,6 +1785,12 @@ void WebContentsImpl::AttachInterstitialPage( |
InterstitialPageImpl* interstitial_page) { |
DCHECK(interstitial_page); |
render_manager_.set_interstitial_page(interstitial_page); |
+ |
+ // Cancel any visible dialogs so that they don't interfere with the |
+ // interstitial. |
+ if (dialog_manager_) |
+ dialog_manager_->CancelActiveAndPendingDialogs(this); |
+ |
FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
DidAttachInterstitialPage()); |
} |