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

Unified Diff: trunk/src/chrome/installer/util/shell_util.cc

Issue 22983003: Revert 217130 "On uninstall, delete shortcuts first, and then re..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/installer/util/shell_util.cc
===================================================================
--- trunk/src/chrome/installer/util/shell_util.cc (revision 217133)
+++ trunk/src/chrome/installer/util/shell_util.cc (working copy)
@@ -1289,12 +1289,10 @@
return success;
}
-// If the folder specified by {|location|, |dist|, |level|} is empty, remove it.
-// Otherwise do nothing. Returns true on success, including the vacuous case
-// where no deletion occurred because the directory is non-empty.
-bool RemoveShortcutFolderIfEmpty(ShellUtil::ShortcutLocation location,
- BrowserDistribution* dist,
- ShellUtil::ShellChange level) {
+// Removes folder spsecified by {|location|, |dist|, |level|}.
+bool RemoveShortcutFolder(ShellUtil::ShortcutLocation location,
+ BrowserDistribution* dist,
+ ShellUtil::ShellChange level) {
// Explicitly whitelist locations, since accidental calls can be very harmful.
if (location != ShellUtil::SHORTCUT_LOCATION_START_MENU &&
@@ -1308,8 +1306,7 @@
LOG(WARNING) << "Cannot find path at location " << location;
return false;
}
- if (file_util::IsDirectoryEmpty(shortcut_folder) &&
- !base::DeleteFile(shortcut_folder, true)) {
+ if (!base::DeleteFile(shortcut_folder, true)) {
LOG(ERROR) << "Cannot remove folder " << shortcut_folder.value();
return false;
}
@@ -2032,13 +2029,8 @@
switch (location) {
case SHORTCUT_LOCATION_START_MENU: // Falls through.
- case SHORTCUT_LOCATION_APP_SHORTCUTS: {
- bool delete_success =
- BatchShortcutAction(base::Bind(&ShortcutOpDelete), location,
- dist, level, target_exe);
- bool rmdir_success = RemoveShortcutFolderIfEmpty(location, dist, level);
- return delete_success && rmdir_success;
- }
+ case SHORTCUT_LOCATION_APP_SHORTCUTS:
+ return RemoveShortcutFolder(location, dist, level);
case SHORTCUT_LOCATION_TASKBAR_PINS:
return BatchShortcutAction(FilterTargetEq(target_exe).
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698