diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-11 04:08:40 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-11 04:08:40 +0000 |
commit | 152ea305aa6528244310077cac67afc8df71bb5a (patch) | |
tree | c835ca1bd19a49492aaa8959ef8242c28d072f65 /chrome/installer/util/install_util.cc | |
parent | 2074e5e82dee830ce07695cd71a1fe04d782f924 (diff) | |
download | chromium_src-152ea305aa6528244310077cac67afc8df71bb5a.zip chromium_src-152ea305aa6528244310077cac67afc8df71bb5a.tar.gz chromium_src-152ea305aa6528244310077cac67afc8df71bb5a.tar.bz2 |
Move FilePath->base::FilePath
Review URL: https://codereview.chromium.org/12213104
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/install_util.cc')
-rw-r--r-- | chrome/installer/util/install_util.cc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index 5b9b0af..0c02d71 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -154,7 +154,7 @@ void InstallUtil::TriggerActiveSetupCommand() { } bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { - FilePath::StringType program(cmd.GetProgram().value()); + base::FilePath::StringType program(cmd.GetProgram().value()); DCHECK(!program.empty()); DCHECK_NE(program[0], L'\"'); @@ -361,14 +361,14 @@ bool CheckIsChromeSxSProcess() { return true; // Also return true if we are running from Chrome SxS installed path. - FilePath exe_dir; + base::FilePath exe_dir; PathService::Get(base::DIR_EXE, &exe_dir); string16 chrome_sxs_dir(installer::kGoogleChromeInstallSubDir2); chrome_sxs_dir.append(installer::kSxSSuffix); - return FilePath::CompareEqualIgnoreCase(exe_dir.BaseName().value(), - installer::kInstallBinaryDir) && - FilePath::CompareEqualIgnoreCase(exe_dir.DirName().BaseName().value(), - chrome_sxs_dir); + return base::FilePath::CompareEqualIgnoreCase( + exe_dir.BaseName().value(), installer::kInstallBinaryDir) && + base::FilePath::CompareEqualIgnoreCase( + exe_dir.DirName().BaseName().value(), chrome_sxs_dir); } bool InstallUtil::IsChromeSxSProcess() { @@ -376,15 +376,15 @@ bool InstallUtil::IsChromeSxSProcess() { return sxs; } -bool InstallUtil::GetSentinelFilePath(const FilePath::CharType* file, +bool InstallUtil::GetSentinelFilePath(const base::FilePath::CharType* file, BrowserDistribution* dist, - FilePath* path) { - FilePath exe_path; + base::FilePath* path) { + base::FilePath exe_path; if (!PathService::Get(base::DIR_EXE, &exe_path)) return false; if (IsPerUserInstall(exe_path.value().c_str())) { - const FilePath maybe_product_dir(exe_path.DirName().DirName()); + const base::FilePath maybe_product_dir(exe_path.DirName().DirName()); if (file_util::PathExists(exe_path.Append(installer::kChromeExe))) { // DIR_EXE is most likely Chrome's directory in which case |exe_path| is // the user-level sentinel path. @@ -401,7 +401,7 @@ bool InstallUtil::GetSentinelFilePath(const FilePath::CharType* file, return false; } } else { - std::vector<FilePath> user_data_dir_paths; + std::vector<base::FilePath> user_data_dir_paths; installer::GetChromeUserDataPaths(dist, &user_data_dir_paths); if (!user_data_dir_paths.empty()) @@ -538,7 +538,7 @@ string16 InstallUtil::GetCurrentDate() { // Open |path| with minimal access to obtain information about it, returning // true and populating |handle| on success. // static -bool InstallUtil::ProgramCompare::OpenForInfo(const FilePath& path, +bool InstallUtil::ProgramCompare::OpenForInfo(const base::FilePath& path, base::win::ScopedHandle* handle) { DCHECK(handle); handle->Set(base::CreatePlatformFile(path, base::PLATFORM_FILE_OPEN, NULL, @@ -555,7 +555,7 @@ bool InstallUtil::ProgramCompare::GetInfo(const base::win::ScopedHandle& handle, const_cast<base::win::ScopedHandle&>(handle), info) != 0; } -InstallUtil::ProgramCompare::ProgramCompare(const FilePath& path_to_match) +InstallUtil::ProgramCompare::ProgramCompare(const base::FilePath& path_to_match) : path_to_match_(path_to_match), file_handle_(base::kInvalidPlatformFileValue), file_info_() { @@ -578,7 +578,7 @@ bool InstallUtil::ProgramCompare::Evaluate(const string16& value) const { // Suss out the exe portion of the value, which is expected to be a command // line kinda (or exactly) like: // "c:\foo\bar\chrome.exe" -- "%1" - FilePath program(CommandLine::FromString(value).GetProgram()); + base::FilePath program(CommandLine::FromString(value).GetProgram()); if (program.empty()) { LOG(WARNING) << "Failed to parse an executable name from command line: \"" << value << "\""; @@ -588,9 +588,11 @@ bool InstallUtil::ProgramCompare::Evaluate(const string16& value) const { return EvaluatePath(program); } -bool InstallUtil::ProgramCompare::EvaluatePath(const FilePath& path) const { +bool InstallUtil::ProgramCompare::EvaluatePath( + const base::FilePath& path) const { // Try the simple thing first: do the paths happen to match? - if (FilePath::CompareEqualIgnoreCase(path_to_match_.value(), path.value())) + if (base::FilePath::CompareEqualIgnoreCase(path_to_match_.value(), + path.value())) return true; // If the paths don't match and we couldn't open the expected file, we've done |