| 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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Use the same UserDataDir for new launches that we currently have set. | 73 // Use the same UserDataDir for new launches that we currently have set. |
| 74 base::FilePath user_data_dir = | 74 base::FilePath user_data_dir = |
| 75 cmd_line.GetSwitchValuePath(switches::kUserDataDir); | 75 cmd_line.GetSwitchValuePath(switches::kUserDataDir); |
| 76 #if defined(OS_MACOSX) || defined(OS_WIN) | 76 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 77 policy::path_parser::CheckUserDataDirPolicy(&user_data_dir); | 77 policy::path_parser::CheckUserDataDirPolicy(&user_data_dir); |
| 78 #endif | 78 #endif |
| 79 if (!user_data_dir.empty()) { | 79 if (!user_data_dir.empty()) { |
| 80 // Make sure user_data_dir is an absolute path. | 80 // Make sure user_data_dir is an absolute path. |
| 81 user_data_dir = base::MakeAbsoluteFilePath(user_data_dir); | 81 user_data_dir = base::MakeAbsoluteFilePath(user_data_dir); |
| 82 if (!user_data_dir.empty() && file_util::PathExists(user_data_dir)) | 82 if (!user_data_dir.empty() && base::PathExists(user_data_dir)) |
| 83 new_cmd_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 83 new_cmd_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
| 84 } | 84 } |
| 85 | 85 |
| 86 #if defined(OS_CHROMEOS) | 86 #if defined(OS_CHROMEOS) |
| 87 base::FilePath profile = cmd_line.GetSwitchValuePath( | 87 base::FilePath profile = cmd_line.GetSwitchValuePath( |
| 88 chromeos::switches::kLoginProfile); | 88 chromeos::switches::kLoginProfile); |
| 89 if (!profile.empty()) | 89 if (!profile.empty()) |
| 90 new_cmd_line.AppendSwitchPath(chromeos::switches::kLoginProfile, profile); | 90 new_cmd_line.AppendSwitchPath(chromeos::switches::kLoginProfile, profile); |
| 91 #else | 91 #else |
| 92 if (!profile_path.empty() && !extension_app_id.empty()) | 92 if (!profile_path.empty() && !extension_app_id.empty()) |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 result = ShellIntegration::SetAsDefaultProtocolClientInteractive( | 296 result = ShellIntegration::SetAsDefaultProtocolClientInteractive( |
| 297 protocol_); | 297 protocol_); |
| 298 } | 298 } |
| 299 break; | 299 break; |
| 300 default: | 300 default: |
| 301 NOTREACHED(); | 301 NOTREACHED(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 return result; | 304 return result; |
| 305 } | 305 } |
| OLD | NEW |