summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/installer_state.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-11 04:08:40 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-11 04:08:40 +0000
commit152ea305aa6528244310077cac67afc8df71bb5a (patch)
treec835ca1bd19a49492aaa8959ef8242c28d072f65 /chrome/installer/util/installer_state.cc
parent2074e5e82dee830ce07695cd71a1fe04d782f924 (diff)
downloadchromium_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/installer_state.cc')
-rw-r--r--chrome/installer/util/installer_state.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index a720137..b5fde77 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -364,7 +364,7 @@ FilePath InstallerState::GetDefaultProductInstallPath(
// We never expect these checks to fail, hence they all terminate the process in
// debug builds. See the log messages for details.
bool InstallerState::CanAddProduct(const Product& product,
- const FilePath* product_dir) const {
+ const base::FilePath* product_dir) const {
switch (package_type_) {
case SINGLE_PACKAGE:
if (!products_.empty()) {
@@ -383,10 +383,10 @@ bool InstallerState::CanAddProduct(const Product& product,
return false;
}
if (!target_path_.empty()) {
- FilePath default_dir;
+ base::FilePath default_dir;
if (product_dir == NULL)
default_dir = GetDefaultProductInstallPath(product.distribution());
- if (!FilePath::CompareEqualIgnoreCase(
+ if (!base::FilePath::CompareEqualIgnoreCase(
(product_dir == NULL ? default_dir : *product_dir).value(),
target_path_.value())) {
LOG(DFATAL) << "Cannot process products in different directories.";
@@ -405,8 +405,9 @@ bool InstallerState::CanAddProduct(const Product& product,
// |product_dir| is NULL, the product's default install location is used.
// Returns NULL if |product| is incompatible with this object. Otherwise,
// returns a pointer to the product (ownership is held by this object).
-Product* InstallerState::AddProductInDirectory(const FilePath* product_dir,
- scoped_ptr<Product>* product) {
+Product* InstallerState::AddProductInDirectory(
+ const base::FilePath* product_dir,
+ scoped_ptr<Product>* product) {
DCHECK(product != NULL);
DCHECK(product->get() != NULL);
const Product& the_product = *product->get();
@@ -471,7 +472,8 @@ Product* InstallerState::AddProductFromState(
product_ptr->InitializeFromUninstallCommand(state.uninstall_command());
// Strip off <version>/Installer/setup.exe; see GetInstallerDirectory().
- FilePath product_dir = state.GetSetupPath().DirName().DirName().DirName();
+ base::FilePath product_dir =
+ state.GetSetupPath().DirName().DirName().DirName();
Product* product = AddProductInDirectory(&product_dir, &product_ptr);
@@ -586,7 +588,7 @@ bool InstallerState::IsChromeFrameRunning(
bool in_use = false;
scoped_ptr<Version> current_version(GetCurrentVersion(machine_state));
if (current_version != NULL) {
- FilePath cf_install_path(
+ base::FilePath cf_install_path(
target_path().AppendASCII(current_version->GetString())
.Append(kChromeFrameDll));
in_use = file_util::PathExists(cf_install_path) &&
@@ -601,7 +603,7 @@ FilePath InstallerState::GetInstallerDirectory(const Version& version) const {
}
// static
-bool InstallerState::IsFileInUse(const FilePath& file) {
+bool InstallerState::IsFileInUse(const base::FilePath& file) {
// Call CreateFile with a share mode of 0 which should cause this to fail
// with ERROR_SHARING_VIOLATION if the file exists and is in-use.
return !base::win::ScopedHandle(CreateFile(file.value().c_str(),
@@ -619,7 +621,7 @@ void InstallerState::GetExistingExeVersions(
};
for (int i = 0; i < arraysize(kChromeFilenames); ++i) {
- FilePath chrome_exe(target_path().Append(kChromeFilenames[i]));
+ base::FilePath chrome_exe(target_path().Append(kChromeFilenames[i]));
scoped_ptr<FileVersionInfo> file_version_info(
FileVersionInfo::CreateFileVersionInfo(chrome_exe));
if (file_version_info) {
@@ -633,9 +635,9 @@ void InstallerState::GetExistingExeVersions(
void InstallerState::RemoveOldVersionDirectories(
const Version& new_version,
Version* existing_version,
- const FilePath& temp_path) const {
+ const base::FilePath& temp_path) const {
Version version;
- std::vector<FilePath> key_files;
+ std::vector<base::FilePath> key_files;
scoped_ptr<WorkItem> item;
std::set<std::string> existing_version_strings;
@@ -650,9 +652,9 @@ void InstallerState::RemoveOldVersionDirectories(
// Try to delete all directories that are not in the set we care to keep.
file_util::FileEnumerator version_enum(target_path(), false,
file_util::FileEnumerator::DIRECTORIES);
- for (FilePath next_version = version_enum.Next(); !next_version.empty();
+ for (base::FilePath next_version = version_enum.Next(); !next_version.empty();
next_version = version_enum.Next()) {
- FilePath dir_name(next_version.BaseName());
+ base::FilePath dir_name(next_version.BaseName());
version = Version(WideToASCII(dir_name.value()));
// Delete the version folder if it is less than the new version and not
// equal to the old version (if we have an old version).
@@ -673,7 +675,8 @@ void InstallerState::RemoveOldVersionDirectories(
}
}
-void InstallerState::AddComDllList(std::vector<FilePath>* com_dll_list) const {
+void InstallerState::AddComDllList(
+ std::vector<base::FilePath>* com_dll_list) const {
std::for_each(products_.begin(), products_.end(),
std::bind2nd(std::mem_fun(&Product::AddComDllList),
com_dll_list));