| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 6 | 6 |
| 7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 695 |
| 696 // Guest or locked profiles cannot be re-opened on startup. The only | 696 // Guest or locked profiles cannot be re-opened on startup. The only |
| 697 // exception is if there's already a Guest window open in a separate | 697 // exception is if there's already a Guest window open in a separate |
| 698 // process (for example, launching a new browser after clicking on a | 698 // process (for example, launching a new browser after clicking on a |
| 699 // downloaded file in Guest mode). | 699 // downloaded file in Guest mode). |
| 700 bool has_guest_browsers = last_used_profile->IsGuestSession() && | 700 bool has_guest_browsers = last_used_profile->IsGuestSession() && |
| 701 chrome::GetTotalBrowserCountForProfile( | 701 chrome::GetTotalBrowserCountForProfile( |
| 702 last_used_profile->GetOffTheRecordProfile()) > 0; | 702 last_used_profile->GetOffTheRecordProfile()) > 0; |
| 703 if (signin_required || | 703 if (signin_required || |
| 704 (last_used_profile->IsGuestSession() && !has_guest_browsers)) { | 704 (last_used_profile->IsGuestSession() && !has_guest_browsers)) { |
| 705 UserManager::Show(base::FilePath(), | 705 profiles::UserManagerProfileSelected action = |
| 706 profiles::USER_MANAGER_NO_TUTORIAL, | 706 command_line.HasSwitch(switches::kShowAppList) ? |
| 707 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 707 profiles::USER_MANAGER_SELECT_PROFILE_APP_LAUNCHER : |
| 708 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION; |
| 709 UserManager::Show( |
| 710 base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, action); |
| 708 return true; | 711 return true; |
| 709 } | 712 } |
| 710 } | 713 } |
| 711 | 714 |
| 712 VLOG(2) << "ProcessCmdLineImpl: PLACE 7.A"; | 715 VLOG(2) << "ProcessCmdLineImpl: PLACE 7.A"; |
| 713 Profile* profile_to_open = last_used_profile->IsGuestSession() ? | 716 Profile* profile_to_open = last_used_profile->IsGuestSession() ? |
| 714 last_used_profile->GetOffTheRecordProfile() : last_used_profile; | 717 last_used_profile->GetOffTheRecordProfile() : last_used_profile; |
| 715 | 718 |
| 716 VLOG(2) << "ProcessCmdLineImpl: PLACE 8.A"; | 719 VLOG(2) << "ProcessCmdLineImpl: PLACE 8.A"; |
| 717 if (!browser_creator->LaunchBrowser(command_line, profile_to_open, | 720 if (!browser_creator->LaunchBrowser(command_line, profile_to_open, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 // If we are showing the app list then chrome isn't shown so load the app | 861 // If we are showing the app list then chrome isn't shown so load the app |
| 859 // list's profile rather than chrome's. | 862 // list's profile rather than chrome's. |
| 860 if (command_line.HasSwitch(switches::kShowAppList)) { | 863 if (command_line.HasSwitch(switches::kShowAppList)) { |
| 861 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 864 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
| 862 GetProfilePath(user_data_dir); | 865 GetProfilePath(user_data_dir); |
| 863 } | 866 } |
| 864 | 867 |
| 865 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 868 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
| 866 user_data_dir); | 869 user_data_dir); |
| 867 } | 870 } |
| OLD | NEW |