From 0302e4ac5907fcdaafbf2a883b29496032c0db19 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Tue, 5 May 2009 19:59:05 +0000 Subject: Remove uses of deprecated version of PathService::Get() in the installer. Review URL: http://codereview.chromium.org/109033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15325 0039d316-1c4b-4281-b951-d872f2087c98 --- .../mini_installer_test/chrome_mini_installer.cc | 20 ++++++++++---------- .../test/mini_installer_test/chrome_mini_installer.h | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'chrome/test/mini_installer_test') diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index 0da0b76..c4601bc 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.cc +++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc @@ -6,6 +6,7 @@ #include +#include "base/file_util.h" #include "base/path_service.h" #include "base/platform_thread.h" #include "base/process_util.h" @@ -368,12 +369,12 @@ void ChromeMiniInstaller::FindChromeShortcut() { // This method returns path to either program files // or documents and setting based on the install type. std::wstring ChromeMiniInstaller::GetChromeInstallDirectoryLocation() { - std::wstring path; + FilePath path; if (install_type_ == mini_installer_constants::kSystemInstall) PathService::Get(base::DIR_PROGRAM_FILES, &path); else PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - return path; + return path.ToWStringHack(); } // This method will create a command line to run apply tag. @@ -403,21 +404,21 @@ bool ChromeMiniInstaller::GetCommandForTagging(std::wstring *return_command) { // Get path for mini_installer.exe. std::wstring ChromeMiniInstaller::GetInstallerExePath(const wchar_t* name) { - std::wstring installer_path; + FilePath installer_path; PathService::Get(base::DIR_EXE, &installer_path); - file_util::AppendToPath(&installer_path, name); - printf("Chrome exe path is %ls\n", installer_path.c_str()); - return installer_path; + installer_path.Append(name); + printf("Chrome exe path is %ls\n", installer_path.value().c_str()); + return installer_path.ToWStringHack(); } // This method gets the shortcut path from startmenu based on install type std::wstring ChromeMiniInstaller::GetStartMenuShortcutPath() { - std::wstring path_name; + FilePath path_name; if (install_type_ == mini_installer_constants::kSystemInstall) PathService::Get(base::DIR_COMMON_START_MENU, &path_name); else PathService::Get(base::DIR_START_MENU, &path_name); - return path_name; + return path_name.ToWStringHack(); } // This is a predicate to sort file_info. @@ -683,8 +684,7 @@ void ChromeMiniInstaller::WaitUntilProcessStopsRunning( PlatformThread::Sleep(200); timer = timer + 200; } - } - else { + } else { ASSERT_EQ(0, base::GetProcessCount(process_name, NULL)); } } diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.h b/chrome/test/mini_installer_test/chrome_mini_installer.h index f8578bd..df93b52 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.h +++ b/chrome/test/mini_installer_test/chrome_mini_installer.h @@ -14,7 +14,7 @@ #include #include -#include "base/file_util.h" +#include "base/basictypes.h" // This structure holds the name and creation time // details of all the chrome nightly builds. @@ -37,7 +37,7 @@ typedef std::vector file_info_list; // This class has methods to install and uninstall Chrome mini installer. class ChromeMiniInstaller { public: - ChromeMiniInstaller(std::wstring type) { + explicit ChromeMiniInstaller(std::wstring type) { install_type_ = type; } @@ -82,7 +82,7 @@ class ChromeMiniInstaller { // Closes First Run UI dialog. void CloseFirstRunUIDialog(bool over_install); - // Close Window whose name is 'window_name', by sending Windows message + // Close Window whose name is 'window_name', by sending Windows message // 'message' to it. bool CloseWindow(const wchar_t* window_name, UINT message); @@ -175,7 +175,7 @@ class ChromeMiniInstaller { // Waits until the given process stops running void WaitUntilProcessStopsRunning(const wchar_t* process_name); - DISALLOW_EVIL_CONSTRUCTORS(ChromeMiniInstaller); + DISALLOW_COPY_AND_ASSIGN(ChromeMiniInstaller); }; #endif // CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H__ -- cgit v1.1