diff options
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_launcher.cc | 9 | ||||
-rw-r--r-- | chrome_frame/chrome_launcher.h | 6 | ||||
-rw-r--r-- | chrome_frame/chrome_tab.cc | 8 | ||||
-rw-r--r-- | chrome_frame/test/perf/chrome_frame_perftest.cc | 6 | ||||
-rw-r--r-- | chrome_frame/test_utils.cc | 13 | ||||
-rw-r--r-- | chrome_frame/test_utils.h | 4 |
6 files changed, 26 insertions, 20 deletions
diff --git a/chrome_frame/chrome_launcher.cc b/chrome_frame/chrome_launcher.cc index f742a28..b9af23d 100644 --- a/chrome_frame/chrome_launcher.cc +++ b/chrome_frame/chrome_launcher.cc @@ -90,10 +90,10 @@ bool SanitizeAndLaunchChrome(const wchar_t* command_line) { return base::LaunchApp(sanitized.command_line_string(), false, false, NULL); } -std::wstring GetChromeExecutablePath() { - std::wstring cur_path; +FilePath GetChromeExecutablePath() { + FilePath cur_path; PathService::Get(base::DIR_MODULE, &cur_path); - file_util::AppendToPath(&cur_path, chrome::kBrowserProcessExecutableName); + cur_path = cur_path.Append(chrome::kBrowserProcessExecutableName); // The installation model for Chrome places the DLLs in a versioned // sub-folder one down from the Chrome executable. If we fail to find @@ -101,8 +101,7 @@ std::wstring GetChromeExecutablePath() { // instead. if (!file_util::PathExists(cur_path)) { PathService::Get(base::DIR_MODULE, &cur_path); - file_util::UpOneDirectory(&cur_path); - file_util::AppendToPath(&cur_path, chrome::kBrowserProcessExecutableName); + cur_path = cur_path.DirName().Append(chrome::kBrowserProcessExecutableName); } return cur_path; diff --git a/chrome_frame/chrome_launcher.h b/chrome_frame/chrome_launcher.h index 7c2aea9..86dc03f 100644 --- a/chrome_frame/chrome_launcher.h +++ b/chrome_frame/chrome_launcher.h @@ -7,6 +7,8 @@ #include <string> +#include "base/file_path.h" + class CommandLine; namespace chrome_launcher { @@ -30,12 +32,12 @@ CommandLine* CreateLaunchCommandLine(); void SanitizeCommandLine(const CommandLine& original, CommandLine* sanitized); // Given a command-line without an initial program part, launch our associated -// chrome.exe with a sanitized version of that command line. Returns true iff +// chrome.exe with a sanitized version of that command line. Returns true iff // successful. bool SanitizeAndLaunchChrome(const wchar_t* command_line); // Returns the full path to the Chrome executable. -std::wstring GetChromeExecutablePath(); +FilePath GetChromeExecutablePath(); // The type of the CfLaunchChrome entrypoint exported from this DLL. typedef int (__stdcall *CfLaunchChromeProc)(); diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc index 923d957d8..601ef06 100644 --- a/chrome_frame/chrome_tab.cc +++ b/chrome_frame/chrome_tab.cc @@ -61,10 +61,10 @@ class ChromeTabModule } if (SUCCEEDED(hr)) { - std::wstring app_path( - chrome_launcher::GetChromeExecutablePath()); - app_path = file_util::GetDirectoryFromPath(app_path); - hr = registrar->AddReplacement(L"CHROME_APPPATH", app_path.c_str()); + FilePath app_path = + chrome_launcher::GetChromeExecutablePath().DirName(); + hr = registrar->AddReplacement(L"CHROME_APPPATH", + app_path.value().c_str()); DCHECK(SUCCEEDED(hr)); } diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc index 79bbd7b..c896fa4 100644 --- a/chrome_frame/test/perf/chrome_frame_perftest.cc +++ b/chrome_frame/test/perf/chrome_frame_perftest.cc @@ -621,7 +621,8 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase { file_util::AppendToPath(&chrome_exe_test_path, chrome::kBrowserProcessExecutableName); - if (!file_util::PathExists(chrome_exe_test_path)) { + if (!file_util::PathExists( + FilePath::FromWStringHack(chrome_exe_test_path))) { file_util::UpOneDirectory(&chrome_exe_path); chrome_exe_test_path = chrome_exe_path; @@ -629,7 +630,8 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase { chrome::kBrowserProcessExecutableName); } - EXPECT_TRUE(file_util::PathExists(chrome_exe_test_path)); + EXPECT_TRUE( + file_util::PathExists(FilePath::FromWStringHack(chrome_exe_test_path))); return chrome_exe_path; } diff --git a/chrome_frame/test_utils.cc b/chrome_frame/test_utils.cc index 2d47c71..abfdbee 100644 --- a/chrome_frame/test_utils.cc +++ b/chrome_frame/test_utils.cc @@ -15,17 +15,18 @@ // Statics -std::wstring ScopedChromeFrameRegistrar::GetChromeFrameBuildPath() { - std::wstring build_path; +FilePath ScopedChromeFrameRegistrar::GetChromeFrameBuildPath() { + FilePath build_path; PathService::Get(chrome::DIR_APP, &build_path); - file_util::AppendToPath(&build_path, L"servers\\npchrome_tab.dll"); + build_path = build_path.Append(L"servers"). + Append(L"npchrome_tab.dll"); file_util::PathExists(build_path); return build_path; } void ScopedChromeFrameRegistrar::RegisterDefaults() { - std::wstring dll_path_ = GetChromeFrameBuildPath(); - RegisterAtPath(dll_path_); + FilePath dll_path = GetChromeFrameBuildPath(); + RegisterAtPath(dll_path.value()); } void ScopedChromeFrameRegistrar::RegisterAtPath( @@ -56,7 +57,7 @@ void ScopedChromeFrameRegistrar::RegisterAtPath( // Non-statics ScopedChromeFrameRegistrar::ScopedChromeFrameRegistrar() { - original_dll_path_ = GetChromeFrameBuildPath(); + original_dll_path_ = GetChromeFrameBuildPath().ToWStringHack(); RegisterChromeFrameAtPath(original_dll_path_); } diff --git a/chrome_frame/test_utils.h b/chrome_frame/test_utils.h index fb470a0..85f5cc5 100644 --- a/chrome_frame/test_utils.h +++ b/chrome_frame/test_utils.h @@ -7,6 +7,8 @@ #include <string> +#include "base/file_path.h" + // Helper class used to register different chrome frame DLLs while running // tests. At construction, this registers the DLL found in the build path. // At destruction, again registers the DLL found in the build path if another @@ -24,7 +26,7 @@ class ScopedChromeFrameRegistrar { std::wstring GetChromeFrameDllPath() const; - static std::wstring GetChromeFrameBuildPath(); + static FilePath GetChromeFrameBuildPath(); static void RegisterAtPath(const std::wstring& path); static void RegisterDefaults(); |