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 1f5657a8edd3fb29d58bf79f689ff067fb13a8de..848cd7d201f99dec77d5f291747983d9ec05cacd 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1421,10 +1421,12 @@ void WebContentsImpl::WasUnOccluded() { |
bool WebContentsImpl::NeedToFireBeforeUnload() { |
// TODO(creis): Should we fire even for interstitial pages? |
+ // TODO(nasko): it's confusing that this method, per comments and tests that |
+ // depend on this behavior, needs to check unload handlers as well. |
return WillNotifyDisconnection() && !ShowingInterstitialPage() && |
!GetRenderViewHost()->SuddenTerminationAllowed() && |
(GetMainFrame()->ShouldDispatchBeforeUnload() || |
- GetMainFrame()->ShouldDispatchUnload()); |
+ GetMainFrame()->HasUnloadHandler()); |
} |
void WebContentsImpl::DispatchBeforeUnload() { |