| 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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 // static | 833 // static |
| 834 bool StartupBrowserCreator::ActivatedProfile() { | 834 bool StartupBrowserCreator::ActivatedProfile() { |
| 835 return profile_launch_observer.Get().activated_profile(); | 835 return profile_launch_observer.Get().activated_profile(); |
| 836 } | 836 } |
| 837 | 837 |
| 838 bool HasPendingUncleanExit(Profile* profile) { | 838 bool HasPendingUncleanExit(Profile* profile) { |
| 839 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 839 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
| 840 !profile_launch_observer.Get().HasBeenLaunched(profile); | 840 !profile_launch_observer.Get().HasBeenLaunched(profile); |
| 841 } | 841 } |
| 842 | 842 |
| 843 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, | 843 base::FilePath GetStartupProfilePath(const base::CommandLine& command_line) { |
| 844 const base::CommandLine& command_line) { | 844 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 845 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 845 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
| 846 return user_data_dir.Append( | 846 return profile_manager->user_data_dir().Append( |
| 847 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 847 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
| 848 } | 848 } |
| 849 | 849 |
| 850 // If we are showing the app list then chrome isn't shown so load the app | 850 // If we are showing the app list then chrome isn't shown so load the app |
| 851 // list's profile rather than chrome's. | 851 // list's profile rather than chrome's. |
| 852 if (command_line.HasSwitch(switches::kShowAppList)) { | 852 if (command_line.HasSwitch(switches::kShowAppList)) { |
| 853 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 853 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE) |
| 854 GetProfilePath(user_data_dir); | 854 ->GetProfilePath(); |
| 855 } | 855 } |
| 856 | 856 |
| 857 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 857 return profile_manager->GetLastUsedProfileDir(); |
| 858 user_data_dir); | |
| 859 } | 858 } |
| OLD | NEW |