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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 11016023: Quickly close tabs/window with long-running unload handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing Created 7 years, 6 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/unload_controller.cc ('k') | chrome/browser/unload_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 04378c8e372a38691892c19ea7d31d9df79ebee8..01379393cdfb5a6d39850a5227595e2430481523 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1831,6 +1831,13 @@ bool BrowserView::CanClose() {
// down. When the tab strip is empty we'll be called back again.
frame_->Hide();
browser_->OnWindowClosing();
+ browser_->tab_strip_model()->CloseAllTabs();
+ return false;
+ } else if (!browser_->HasCompletedUnloadProcessing()) {
+ // The browser needs to finish running unload handlers.
+ // Hide the frame (so it appears to have closed immediately), and
+ // the browser will call us back again when it is ready to close.
+ frame_->Hide();
return false;
}
« no previous file with comments | « chrome/browser/ui/unload_controller.cc ('k') | chrome/browser/unload_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698