OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 } | 893 } |
894 } | 894 } |
895 #endif | 895 #endif |
896 } | 896 } |
897 | 897 |
898 // Initializes the profile, possibly doing some user prompting to pick a | 898 // Initializes the profile, possibly doing some user prompting to pick a |
899 // fallback profile. Returns the newly created profile, or NULL if startup | 899 // fallback profile. Returns the newly created profile, or NULL if startup |
900 // should not continue. | 900 // should not continue. |
901 Profile* CreateProfile(const MainFunctionParams& parameters, | 901 Profile* CreateProfile(const MainFunctionParams& parameters, |
902 const FilePath& user_data_dir) { | 902 const FilePath& user_data_dir) { |
903 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 903 Profile* profile = ProfileManager::IsMultipleProfilesEnabled() ? |
904 Profile* profile = browser_command_line.HasSwitch(switches::kMultiProfiles) ? | |
905 g_browser_process->profile_manager()->GetLastUsedProfile(user_data_dir) : | 904 g_browser_process->profile_manager()->GetLastUsedProfile(user_data_dir) : |
906 g_browser_process->profile_manager()->GetDefaultProfile(user_data_dir); | 905 g_browser_process->profile_manager()->GetDefaultProfile(user_data_dir); |
907 if (profile) | 906 if (profile) |
908 return profile; | 907 return profile; |
909 | 908 |
910 #if defined(OS_WIN) | 909 #if defined(OS_WIN) |
911 // Ideally, we should be able to run w/o access to disk. For now, we | 910 // Ideally, we should be able to run w/o access to disk. For now, we |
912 // prompt the user to pick a different user-data-dir and restart chrome | 911 // prompt the user to pick a different user-data-dir and restart chrome |
913 // with the new dir. | 912 // with the new dir. |
914 // http://code.google.com/p/chromium/issues/detail?id=11510 | 913 // http://code.google.com/p/chromium/issues/detail?id=11510 |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 #if defined(OS_CHROMEOS) | 2074 #if defined(OS_CHROMEOS) |
2076 // To be precise, logout (browser shutdown) is not yet done, but the | 2075 // To be precise, logout (browser shutdown) is not yet done, but the |
2077 // remaining work is negligible, hence we say LogoutDone here. | 2076 // remaining work is negligible, hence we say LogoutDone here. |
2078 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 2077 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
2079 false); | 2078 false); |
2080 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 2079 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
2081 #endif | 2080 #endif |
2082 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 2081 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
2083 return result_code; | 2082 return result_code; |
2084 } | 2083 } |
OLD | NEW |