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

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

Issue 471763008: Nicely handle OnBeforeUnloads with guest and lock mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup browser close; callback reset Created 6 years, 4 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
Index: chrome/browser/ui/unload_controller.cc
diff --git a/chrome/browser/ui/unload_controller.cc b/chrome/browser/ui/unload_controller.cc
index fab4eb76d245679c9559e4763ceeb6c1f03b3ca6..e0cc70e6291d8be530d13927643dfebec62429cf 100644
--- a/chrome/browser/ui/unload_controller.cc
+++ b/chrome/browser/ui/unload_controller.cc
@@ -300,7 +300,10 @@ void UnloadController::ProcessPendingTabs() {
ClearUnloadState(web_contents, true);
}
} else if (is_calling_before_unload_handlers()) {
- on_close_confirmed_.Run(true);
+ base::Callback<void(bool)> on_close_confirmed = on_close_confirmed_;
+ if (tabs_needing_unload_fired_.empty())
+ on_close_confirmed_.Reset();
Peter Kasting 2014/08/28 18:46:13 Clearly order is important here; add comments expl
Mike Lerman 2014/08/29 18:02:21 Done.
+ on_close_confirmed.Run(true);
} else if (!tabs_needing_unload_fired_.empty()) {
// We've finished firing all beforeunload events and can proceed with unload
// events.

Powered by Google App Engine
This is Rietveld 408576698