Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5746)

Unified Diff: chrome/installer/setup/uninstall.cc

Issue 2110021: Use FilePath::DirName instead of the deprecated file_util::GetDirectoryFromPath. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: fix win Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | webkit/default_plugin/plugin_impl_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/uninstall.cc
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 79ccdbec53ea4278994864cca77f110594af47e2..4338cb636a1c47709af05532ed2c66a2b9b0893a 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -139,20 +139,21 @@ bool ScheduleParentAndGrandparentForDeletion(const FilePath& path) {
}
// Deletes empty parent & empty grandparent dir of given path.
-bool DeleteEmptyParentDir(const std::wstring& path) {
+bool DeleteEmptyParentDir(const FilePath& path) {
bool ret = true;
- std::wstring parent_dir = file_util::GetDirectoryFromPath(path);
- if (!parent_dir.empty() && file_util::IsDirectoryEmpty(parent_dir)) {
+ FilePath parent_dir = path.DirName();
+ if (!parent_dir.empty() && file_util::IsDirectoryEmpty(parent_dir.value())) {
if (!file_util::Delete(parent_dir, true)) {
ret = false;
- LOG(ERROR) << "Failed to delete folder: " << parent_dir;
+ LOG(ERROR) << "Failed to delete folder: " << parent_dir.value();
}
- parent_dir = file_util::GetDirectoryFromPath(parent_dir);
- if (!parent_dir.empty() && file_util::IsDirectoryEmpty(parent_dir)) {
+ parent_dir = parent_dir.DirName();
+ if (!parent_dir.empty() &&
+ file_util::IsDirectoryEmpty(parent_dir.value())) {
tony 2010/05/24 03:32:29 Nit: It would be good to make a FilePath version o
if (!file_util::Delete(parent_dir, true)) {
ret = false;
- LOG(ERROR) << "Failed to delete folder: " << parent_dir;
+ LOG(ERROR) << "Failed to delete folder: " << parent_dir.value();
}
}
}
@@ -257,7 +258,7 @@ DeleteResult DeleteFilesAndFolders(const std::wstring& exe_path,
if (result == DELETE_REQUIRES_REBOOT) {
ScheduleParentAndGrandparentForDeletion(user_local_state);
} else {
- DeleteEmptyParentDir(user_local_state.value());
+ DeleteEmptyParentDir(user_local_state);
}
}
@@ -269,7 +270,7 @@ DeleteResult DeleteFilesAndFolders(const std::wstring& exe_path,
} else {
// Now check and delete if the parent directories are empty
// For example Google\Chrome or Chromium
- DeleteEmptyParentDir(install_path);
+ DeleteEmptyParentDir(FilePath(install_path));
}
return result;
}
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | webkit/default_plugin/plugin_impl_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698