Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
index adcb2f366181de34fb85c5084bf6f867a1759888..e304a682999191831a9afba2a775d4a3bbb5f067 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -781,10 +781,16 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser(Browser* browser, |
chrome::ActivateTabAt(browser, 0, false); |
} |
- browser->window()->Show(); |
- // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial |
- // focus explicitly. |
- chrome::GetActiveWebContents(browser)->GetView()->SetInitialFocus(); |
+ // The default behaviour is to show the window, as expressed by the default |
+ // value of StartupBrowserCreated::show_main_browser_window_. If this was set |
+ // to true ahead of this place, it means another task must have been spawned |
+ // to take care of that. |
+ if (!browser_creator_ || browser_creator_->show_main_browser_window()) { |
+ browser->window()->Show(); |
+ // TODO(jcampan): http://crbug.com/8123 we should not need to set the |
+ // initial focus explicitly. |
+ chrome::GetActiveWebContents(browser)->GetView()->SetInitialFocus(); |
+ } |
return browser; |
} |