Chromium Code Reviews| Index: chrome/browser/ui/startup/startup_browser_creator.cc |
| diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc |
| index b972539badf3da9b079db1ee3a62da9e72eb4b59..d4355f390f3970c14600c65c059d2af3a272f5f9 100644 |
| --- a/chrome/browser/ui/startup/startup_browser_creator.cc |
| +++ b/chrome/browser/ui/startup/startup_browser_creator.cc |
| @@ -633,15 +633,26 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( |
| bool signin_required = profile_index != std::string::npos && |
| profile_info.ProfileIsSigninRequiredAtIndex(profile_index); |
| - // Guest or locked profiles cannot be re-opened on startup. |
| - if (signin_required || last_used_profile->IsGuestSession()) { |
| + // Guest or locked profiles cannot be re-opened on startup. The only |
| + // exception is if there's already a Guest window open in a separate |
| + // process (for example, launching a new browser after clicking on a |
| + // downloaded file in Guest mode). |
| + bool has_guest_browsers = last_used_profile->IsGuestSession() ? |
|
sky
2014/10/31 22:39:45
nit: = last_used_profile->IsGuestSession() && chro
noms (inactive)
2014/11/03 15:05:03
Done.
|
| + chrome::GetTotalBrowserCountForProfile( |
| + last_used_profile->GetOffTheRecordProfile()) > 0 : false; |
| + if (signin_required || |
| + (last_used_profile->IsGuestSession() && !has_guest_browsers)) { |
| UserManager::Show(base::FilePath(), |
| profiles::USER_MANAGER_NO_TUTORIAL, |
| profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| return true; |
| } |
| } |
| - if (!browser_creator->LaunchBrowser(command_line, last_used_profile, |
| + |
| + Profile* profile_to_open = last_used_profile->IsGuestSession() ? |
| + last_used_profile->GetOffTheRecordProfile() : last_used_profile; |
| + |
| + if (!browser_creator->LaunchBrowser(command_line, profile_to_open, |
| cur_dir, is_process_startup, |
| is_first_run, return_code)) { |
| return false; |