| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_utils.h" | 5 #include "chrome_frame/chrome_launcher_utils.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" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/win_util.h" | 12 #include "base/win/windows_version.h" |
| 13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome_frame/chrome_frame_automation.h" | 15 #include "chrome_frame/chrome_frame_automation.h" |
| 16 | 16 |
| 17 namespace chrome_launcher { | 17 namespace chrome_launcher { |
| 18 | 18 |
| 19 const wchar_t kLauncherExeBaseName[] = L"chrome_launcher.exe"; | 19 const wchar_t kLauncherExeBaseName[] = L"chrome_launcher.exe"; |
| 20 | 20 |
| 21 CommandLine* CreateLaunchCommandLine() { | 21 CommandLine* CreateLaunchCommandLine() { |
| 22 // Shortcut for OS versions that don't need the integrity broker. | 22 // Shortcut for OS versions that don't need the integrity broker. |
| 23 if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { | 23 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
| 24 return new CommandLine(GetChromeExecutablePath()); | 24 return new CommandLine(GetChromeExecutablePath()); |
| 25 } | 25 } |
| 26 | 26 |
| 27 // The launcher EXE will be in the same directory as the Chrome Frame DLL, | 27 // The launcher EXE will be in the same directory as the Chrome Frame DLL, |
| 28 // so create a full path to it based on this assumption. Since our unit | 28 // so create a full path to it based on this assumption. Since our unit |
| 29 // tests also use this function, and live in the directory above, we test | 29 // tests also use this function, and live in the directory above, we test |
| 30 // existence of the file and try the path that includes the /servers/ | 30 // existence of the file and try the path that includes the /servers/ |
| 31 // directory if needed. | 31 // directory if needed. |
| 32 FilePath module_path; | 32 FilePath module_path; |
| 33 if (PathService::Get(base::FILE_MODULE, &module_path)) { | 33 if (PathService::Get(base::FILE_MODULE, &module_path)) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 59 // instead. | 59 // instead. |
| 60 if (!file_util::PathExists(cur_path)) { | 60 if (!file_util::PathExists(cur_path)) { |
| 61 PathService::Get(base::DIR_MODULE, &cur_path); | 61 PathService::Get(base::DIR_MODULE, &cur_path); |
| 62 cur_path = cur_path.DirName().Append(chrome::kBrowserProcessExecutableName); | 62 cur_path = cur_path.DirName().Append(chrome::kBrowserProcessExecutableName); |
| 63 } | 63 } |
| 64 | 64 |
| 65 return cur_path; | 65 return cur_path; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace chrome_launcher | 68 } // namespace chrome_launcher |
| OLD | NEW |