| Index: chrome/browser/tab_contents/tab_contents.cc | 
| =================================================================== | 
| --- chrome/browser/tab_contents/tab_contents.cc	(revision 68655) | 
| +++ chrome/browser/tab_contents/tab_contents.cc	(working copy) | 
| @@ -849,6 +849,13 @@ | 
| WasHidden(); | 
| } | 
|  | 
| +bool TabContents::NeedToFireBeforeUnload() { | 
| +  // TODO(creis): Should we fire even for interstitial pages? | 
| +  return notify_disconnection() && | 
| +      !showing_interstitial_page() && | 
| +      !render_view_host()->SuddenTerminationAllowed(); | 
| +} | 
| + | 
| void TabContents::OpenURL(const GURL& url, const GURL& referrer, | 
| WindowOpenDisposition disposition, | 
| PageTransition::Type transition) { | 
| @@ -2792,6 +2799,8 @@ | 
|  | 
| void TabContents::RunBeforeUnloadConfirm(const std::wstring& message, | 
| IPC::Message* reply_msg) { | 
| +  if (delegate()) | 
| +    delegate()->WillRunBeforeUnloadConfirm(); | 
| if (delegate() && delegate()->ShouldSuppressDialogs()) { | 
| render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, | 
| std::wstring()); | 
|  |