| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_frame/chrome_launcher.h" | 5 #include "chrome_frame/chrome_launcher.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool SanitizeAndLaunchChrome(const wchar_t* command_line) { | 83 bool SanitizeAndLaunchChrome(const wchar_t* command_line) { |
| 84 std::wstring command_line_with_program(L"dummy.exe "); | 84 std::wstring command_line_with_program(L"dummy.exe "); |
| 85 command_line_with_program += command_line; | 85 command_line_with_program += command_line; |
| 86 CommandLine original = CommandLine::FromString(command_line_with_program); | 86 CommandLine original = CommandLine::FromString(command_line_with_program); |
| 87 CommandLine sanitized(GetChromeExecutablePath()); | 87 CommandLine sanitized(GetChromeExecutablePath()); |
| 88 SanitizeCommandLine(original, &sanitized); | 88 SanitizeCommandLine(original, &sanitized); |
| 89 | 89 |
| 90 DLOG(INFO) << sanitized.command_line_string(); |
| 91 sanitized.AppendSwitchWithValue("log-level", "0"); |
| 92 |
| 90 return base::LaunchApp(sanitized.command_line_string(), false, false, NULL); | 93 return base::LaunchApp(sanitized.command_line_string(), false, false, NULL); |
| 91 } | 94 } |
| 92 | 95 |
| 93 FilePath GetChromeExecutablePath() { | 96 FilePath GetChromeExecutablePath() { |
| 94 FilePath cur_path; | 97 FilePath cur_path; |
| 95 PathService::Get(base::DIR_MODULE, &cur_path); | 98 PathService::Get(base::DIR_MODULE, &cur_path); |
| 96 cur_path = cur_path.Append(chrome::kBrowserProcessExecutableName); | 99 cur_path = cur_path.Append(chrome::kBrowserProcessExecutableName); |
| 97 | 100 |
| 98 // The installation model for Chrome places the DLLs in a versioned | 101 // The installation model for Chrome places the DLLs in a versioned |
| 99 // sub-folder one down from the Chrome executable. If we fail to find | 102 // sub-folder one down from the Chrome executable. If we fail to find |
| (...skipping 17 matching lines...) Expand all Loading... |
| 117 return ERROR_OPEN_FAILED; | 120 return ERROR_OPEN_FAILED; |
| 118 } | 121 } |
| 119 } | 122 } |
| 120 | 123 |
| 121 // Compile-time check to see that the type CfLaunchChromeProc is correct. | 124 // Compile-time check to see that the type CfLaunchChromeProc is correct. |
| 122 #ifndef NODEBUG | 125 #ifndef NODEBUG |
| 123 namespace { | 126 namespace { |
| 124 chrome_launcher::CfLaunchChromeProc cf_launch_chrome = CfLaunchChrome; | 127 chrome_launcher::CfLaunchChromeProc cf_launch_chrome = CfLaunchChrome; |
| 125 } // namespace | 128 } // namespace |
| 126 #endif // NODEBUG | 129 #endif // NODEBUG |
| OLD | NEW |