Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1925)

Unified Diff: chrome/browser/ui/fast_unload_controller.cc

Issue 1931793002: Stop using nested message loop for alert() and other JS dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments and removed unused declaration Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/fast_unload_controller.h ('k') | chrome/browser/ui/unload_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/fast_unload_controller.cc
diff --git a/chrome/browser/ui/fast_unload_controller.cc b/chrome/browser/ui/fast_unload_controller.cc
index 61f62c0288da7c8ec534723e9386ba5b4ca9e1b5..9f4dc2adf87942bb350f2ba5ec72cf95842661c2 100644
--- a/chrome/browser/ui/fast_unload_controller.cc
+++ b/chrome/browser/ui/fast_unload_controller.cc
@@ -73,7 +73,6 @@ bool FastUnloadController::CanCloseContents(content::WebContents* contents) {
is_calling_before_unload_handlers();
}
-// static
bool FastUnloadController::ShouldRunUnloadEventsHelper(
content::WebContents* contents) {
// If |contents| is being inspected, devtools needs to intercept beforeunload
@@ -81,9 +80,15 @@ bool FastUnloadController::ShouldRunUnloadEventsHelper(
return DevToolsWindow::GetInstanceForInspectedWebContents(contents) != NULL;
}
-// static
bool FastUnloadController::RunUnloadEventsHelper(
content::WebContents* contents) {
+ // Special case for when we quit an application. The Devtools window can
+ // close if it's beforeunload event has already fired which will happen due
+ // to the interception of it's content's beforeunload.
+ if (browser_->is_devtools() &&
+ DevToolsWindow::HasFiredBeforeUnloadEventForDevToolsBrowser(browser_))
+ return false;
+
// If there's a devtools window attached to |contents|,
// we would like devtools to call its own beforeunload handlers first,
// and then call beforeunload handlers for |contents|.
« no previous file with comments | « chrome/browser/ui/fast_unload_controller.h ('k') | chrome/browser/ui/unload_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698