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 e80ec5bfe9e760c3a417cc033b53080d0ceb9af4..9f4f90f5b544bb783d9b51eeabbf0ff73a205a57 100644 |
--- a/chrome/browser/ui/views/frame/browser_view.cc |
+++ b/chrome/browser/ui/views/frame/browser_view.cc |
@@ -1775,15 +1775,13 @@ bool BrowserView::CanClose() { |
// 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 frame (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. |
- frame_->Hide(); |
- 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. |
+ frame_->Hide(); |
+ } |
return false; |
} |