Index: chrome/browser/ui/gtk/browser_window_gtk.cc |
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc |
index ce8827d6f42a563fd368c0b58defbef5cc44843f..521ef3e8350706ead003b3453aac7862a8a9c799 100644 |
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc |
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc |
@@ -1449,6 +1449,13 @@ bool BrowserWindowGtk::CanClose() const { |
// down. When the tab strip is empty we'll be called back again. |
gtk_widget_hide(GTK_WIDGET(window_)); |
browser_->OnWindowClosing(); |
+ browser_->tab_strip_model()->CloseAllTabs(); |
+ return false; |
+ } else if (!browser_->HasCompletedUnloadProcessing()) { |
+ // The browser needs to finish running unload handlers. |
+ // Hide the window (so it appears to have closed immediately), and |
+ // the browser will call us back again when it is ready to close. |
+ gtk_widget_hide(GTK_WIDGET(window_)); |
return false; |
} |