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 e9820ab3cdea0adbb0099e4b577c38389f298693..3f581c201ad8c1b713fac282a74714c492680b80 100644 |
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc |
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc |
@@ -1447,15 +1447,13 @@ bool BrowserWindowGtk::CanClose() const { |
// Give beforeunload handlers the chance to cancel the close before we hide |
// the window below. |
- if (!browser_->ShouldCloseWindow()) |
- return false; |
- |
- if (!browser_->tab_strip_model()->empty()) { |
- // Tab strip isn't empty. Hide the window (so it appears to have closed |
- // immediately) and close all the tabs, allowing the renderers to shut |
- // down. When the tab strip is empty we'll be called back again. |
- gtk_widget_hide(GTK_WIDGET(window_)); |
- browser_->OnWindowClosing(); |
+ if (!browser_->ShouldCloseWindow()) { |
+ if (browser_->tab_strip_model()->empty()) { |
+ // 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; |
} |