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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 return profile_launch_observer.Get().activated_profile(); | 721 return profile_launch_observer.Get().activated_profile(); |
722 } | 722 } |
723 | 723 |
724 bool HasPendingUncleanExit(Profile* profile) { | 724 bool HasPendingUncleanExit(Profile* profile) { |
725 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 725 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
726 !profile_launch_observer.Get().HasBeenLaunched(profile); | 726 !profile_launch_observer.Get().HasBeenLaunched(profile); |
727 } | 727 } |
728 | 728 |
729 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, | 729 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, |
730 const CommandLine& command_line) { | 730 const CommandLine& command_line) { |
| 731 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
| 732 return user_data_dir.Append( |
| 733 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
| 734 } |
| 735 |
731 // If we are showing the app list then chrome isn't shown so load the app | 736 // If we are showing the app list then chrome isn't shown so load the app |
732 // list's profile rather than chrome's. | 737 // list's profile rather than chrome's. |
733 if (command_line.HasSwitch(switches::kShowAppList)) { | 738 if (command_line.HasSwitch(switches::kShowAppList)) { |
734 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 739 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
735 GetProfilePath(user_data_dir); | 740 GetProfilePath(user_data_dir); |
736 } | 741 } |
737 | 742 |
738 if (command_line.HasSwitch(switches::kProfileDirectory)) { | |
739 return user_data_dir.Append( | |
740 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | |
741 } | |
742 | |
743 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 743 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
744 user_data_dir); | 744 user_data_dir); |
745 } | 745 } |
OLD | NEW |