| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 // Need to include this before most other files because it defines | 7 // Need to include this before most other files because it defines |
| 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define | 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define |
| 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the | 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the |
| 10 // ViewMsgLog et al. functions. | 10 // ViewMsgLog et al. functions. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 base::FilePath GetSessionLogFile(const CommandLine& command_line) { | 200 base::FilePath GetSessionLogFile(const CommandLine& command_line) { |
| 201 base::FilePath log_dir; | 201 base::FilePath log_dir; |
| 202 std::string log_dir_str; | 202 std::string log_dir_str; |
| 203 scoped_ptr<base::Environment> env(base::Environment::Create()); | 203 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 204 if (env->GetVar(env_vars::kSessionLogDir, &log_dir_str) && | 204 if (env->GetVar(env_vars::kSessionLogDir, &log_dir_str) && |
| 205 !log_dir_str.empty()) { | 205 !log_dir_str.empty()) { |
| 206 log_dir = base::FilePath(log_dir_str); | 206 log_dir = base::FilePath(log_dir_str); |
| 207 } else if (command_line.HasSwitch(chromeos::switches::kLoginProfile)) { | 207 } else if (command_line.HasSwitch(chromeos::switches::kLoginProfile)) { |
| 208 PathService::Get(chrome::DIR_USER_DATA, &log_dir); | 208 PathService::Get(chrome::DIR_USER_DATA, &log_dir); |
| 209 base::FilePath profile_dir; | 209 base::FilePath profile_dir; |
| 210 if (command_line.HasSwitch(switches::kMultiProfiles)) { | 210 std::string login_profile_value = |
| 211 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile); |
| 212 if (login_profile_value == chrome::kLegacyProfileDir) { |
| 213 profile_dir = base::FilePath(login_profile_value); |
| 214 } else { |
| 211 // We could not use g_browser_process > profile_helper() here. | 215 // We could not use g_browser_process > profile_helper() here. |
| 212 std::string profile_dir_str = chrome::kProfileDirPrefix; | 216 std::string profile_dir_str = chrome::kProfileDirPrefix; |
| 213 profile_dir_str.append( | 217 profile_dir_str.append(login_profile_value); |
| 214 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile)); | |
| 215 profile_dir = base::FilePath(profile_dir_str); | 218 profile_dir = base::FilePath(profile_dir_str); |
| 216 } else { | |
| 217 profile_dir = | |
| 218 command_line.GetSwitchValuePath(chromeos::switches::kLoginProfile); | |
| 219 } | 219 } |
| 220 log_dir = log_dir.Append(profile_dir); | 220 log_dir = log_dir.Append(profile_dir); |
| 221 } | 221 } |
| 222 return log_dir.Append(GetLogFileName().BaseName()); | 222 return log_dir.Append(GetLogFileName().BaseName()); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void RedirectChromeLogging(const CommandLine& command_line) { | 225 void RedirectChromeLogging(const CommandLine& command_line) { |
| 226 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) && | 226 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) && |
| 227 chrome_logging_redirected_) { | 227 chrome_logging_redirected_) { |
| 228 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345 | 228 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 time_deets.year, | 455 time_deets.year, |
| 456 time_deets.month, | 456 time_deets.month, |
| 457 time_deets.day_of_month, | 457 time_deets.day_of_month, |
| 458 time_deets.hour, | 458 time_deets.hour, |
| 459 time_deets.minute, | 459 time_deets.minute, |
| 460 time_deets.second); | 460 time_deets.second); |
| 461 return base_path.InsertBeforeExtensionASCII(suffix); | 461 return base_path.InsertBeforeExtensionASCII(suffix); |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace logging | 464 } // namespace logging |
| OLD | NEW |