Chromium Code Reviews| 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()) { |
|
sky
2012/08/08 21:24:13
Who is keeping chrome alive if you don't show a br
motek.
2012/08/09 14:26:56
I believe the actual widget exists by this point (
|
| + 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; |
| } |