Index: chrome/browser/ui/cocoa/browser_window_controller.mm |
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm |
index 2aac9f40ba24aa1bd415f0c69b58991a43e60486..608ac875042ecf33b2c84f6fa9c2fdccea864dc1 100644 |
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm |
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm |
@@ -597,15 +597,20 @@ enum { |
// have to save the window position before we call orderOut:. |
[self saveWindowPositionIfNeeded]; |
+ bool fast_tab_closing_enabled = |
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableFastUnload); |
+ |
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. |
[[self window] orderOut:self]; |
browser_->OnWindowClosing(); |
- browser_->tab_strip_model()->CloseAllTabs(); |
+ if (fast_tab_closing_enabled) |
+ browser_->tab_strip_model()->CloseAllTabs(); |
return NO; |
- } else if (!browser_->HasCompletedUnloadProcessing()) { |
+ } else if (fast_tab_closing_enabled && |
+ !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. |