| 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 dec5ac81df4d671cf1acc0910d7164f5e758827c..3d7ea91d3ecd35612030b63f1e67444bc713c964 100644
|
| --- a/chrome/browser/ui/views/frame/browser_view.cc
|
| +++ b/chrome/browser/ui/views/frame/browser_view.cc
|
| @@ -1815,15 +1815,20 @@ bool BrowserView::CanClose() {
|
| 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 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();
|
| - 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 frame (so it appears to have closed immediately), and
|
| // the browser will call us back again when it is ready to close.
|
|
|