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 9ea079f53d99aac2954565d3968c24ca1fd45c72..e5f90932df99e7de487d26fbafbf3bd4d13b149b 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -845,7 +845,11 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( |
return; |
if (HasPendingUncleanExit(browser->profile())) { |
- if (!command_line_.HasSwitch(switches::kEnableSessionCrashedBubble) || |
+ // Can't use command_line_ here because command_line_ isn't set to have |
+ // correct values when a profile window is opened after the browser starts |
+ // up (via profile switcher). See function FindOrCreateNewWindowForProfile. |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableSessionCrashedBubble) || |
!ShowSessionCrashedBubble(browser)) |
SessionCrashedInfoBarDelegate::Create(browser); |
} |