| 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 f343c44ecf2e4b762abb3a6a910fe559416d8ae5..0827d8e2a522d3bfea19a23bab16927753c36d6c 100644
|
| --- a/chrome/browser/ui/gtk/browser_window_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
|
| @@ -1443,15 +1443,20 @@ bool BrowserWindowGtk::CanClose() const {
|
| if (!browser_->ShouldCloseWindow())
|
| return false;
|
|
|
| + bool fast_tab_closing_enabled =
|
| + CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableFastUnload);
|
| +
|
| 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();
|
| - browser_->tab_strip_model()->CloseAllTabs();
|
| + if (fast_tab_closing_enabled)
|
| + browser_->tab_strip_model()->CloseAllTabs();
|
| return false;
|
| - } 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.
|
|
|