Index: chrome/browser/js_modal_dialog.cc |
diff --git a/chrome/browser/js_modal_dialog.cc b/chrome/browser/js_modal_dialog.cc |
index 111aa01af5c640a79ff157058d6f11a1f14e0516..7c42c71fd8de9f21775e3f8a5c5fec1b39daac31 100644 |
--- a/chrome/browser/js_modal_dialog.cc |
+++ b/chrome/browser/js_modal_dialog.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/js_modal_dialog.h" |
#include "base/string_util.h" |
+#include "chrome/browser/browser_shutdown.h" |
#include "chrome/browser/extensions/extension_host.h" |
#include "chrome/browser/tab_contents/tab_contents.h" |
#include "chrome/common/notification_service.h" |
@@ -90,6 +91,11 @@ void JavaScriptAppModalDialog::InitNotifications() { |
} |
void JavaScriptAppModalDialog::OnCancel() { |
+ // If we are shutting down and this is an onbeforeunload dialog, cancel the |
+ // shutdown. |
+ if (is_before_unload_dialog_) |
+ browser_shutdown::SetTryingToQuit(false); |
+ |
// We need to do this before WM_DESTROY (WindowClosing()) as any parent frame |
// will receive its activation messages before this dialog receives |
// WM_DESTROY. The parent frame would then try to activate any modal dialogs |