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

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

Issue 14287008: Refactoring installer shortcut deletion; adding dedicated shortcut update feature. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fixes; reduced RemoveShortcuts() to a single interface. Created 7 years, 8 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
Index: chrome/installer/setup/uninstall.cc
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index f34de8e5925959c8967aba6b11441bb0c42889cb..f4fde803e41b9c76fa33de80de55e0dc49d5b308 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -339,41 +339,40 @@ void DeleteShortcuts(const InstallerState& installer_state,
ShellUtil::ShellChange install_level = installer_state.system_install() ?
ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER;
- VLOG(1) << "Deleting Desktop shortcut.";
- if (!ShellUtil::RemoveShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist,
- target_exe, install_level, NULL)) {
- LOG(WARNING) << "Failed to delete Desktop shortcut.";
- }
- // Also try to delete the alternate desktop shortcut. It is not sufficient
- // to do so upon failure of the above call as ERROR_FILE_NOT_FOUND on
- // delete is considered success.
- if (!ShellUtil::RemoveShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist, target_exe, install_level,
- &dist->GetAlternateApplicationName())) {
- LOG(WARNING) << "Failed to delete alternate Desktop shortcut.";
+ VLOG(1) << "Deleting Desktop shortcuts.";
+ if (!ShellUtil::RemoveShortcuts(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist,
+ install_level, target_exe)) {
+ LOG(WARNING) << "Failed to delete Desktop shortcuts.";
}
- VLOG(1) << "Deleting Quick Launch shortcut.";
- if (!ShellUtil::RemoveShortcut(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH,
- dist, target_exe, install_level, NULL)) {
- LOG(WARNING) << "Failed to delete Quick Launch shortcut.";
+ VLOG(1) << "Deleting Quick Launch shortcuts.";
+ if (!ShellUtil::RemoveShortcuts(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH,
+ dist, install_level, target_exe)) {
+ LOG(WARNING) << "Failed to delete Quick Launch shortcuts.";
}
VLOG(1) << "Deleting Start Menu shortcuts.";
- if (!ShellUtil::RemoveShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist,
- target_exe, install_level, NULL)) {
+ if (!ShellUtil::RemoveShortcuts(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist,
+ install_level, target_exe)) {
LOG(WARNING) << "Failed to delete Start Menu shortcuts.";
}
- // Although the shortcut removal calls above will unpin their shortcut if they
- // result in a deletion (i.e. shortcut existed and pointed to |target_exe|),
- // it is possible for shortcuts to remain pinned while their parent shortcut
- // has been deleted or changed to point to another |target_exe|. Make sure all
- // pinned-to-taskbar shortcuts that point to |target_exe| are unpinned.
- ShellUtil::RemoveTaskbarShortcuts(target_exe.value());
+ // Perform dedicated unpinning pinned-to-taskbar shortcuts, rather than
+ // during shortcut removal above (which is unreliable since shortcuts may be
+ // retargeted at some point).
gab 2013/04/30 22:30:22 "Unpin all pinned-to-taskbar shortcuts that point
huangs 2013/05/01 04:11:51 Done.
+ if (!ShellUtil::RemoveShortcuts(ShellUtil::SHORTCUT_LOCATION_TASKBAR_PINS,
+ dist, ShellUtil::CURRENT_USER, target_exe)) {
+ LOG_IF(WARNING, base::win::GetVersion() >= base::win::VERSION_WIN7)
+ << "Failed to unpin taskbar shortcuts at user-level.";
+ }
- ShellUtil::RemoveStartScreenShortcuts(product.distribution(),
- target_exe.value());
+ // Remove all secondary tiles with target set to |target_exe| from the
+ // start screen for |dist|.
gab 2013/04/30 22:30:22 This comment is wrong, the code actually deletes t
huangs 2013/05/01 04:11:51 Just copying the old comment for RemoveStartScreen
+ if (!ShellUtil::RemoveShortcuts(ShellUtil::SHORTCUT_LOCATION_APP_SHORTCUTS,
+ dist, install_level, target_exe)) {
+ LOG_IF(WARNING, base::win::GetVersion() >= base::win::VERSION_WIN8)
+ << "Failed to delete start-screen shortcuts.";
+ }
}
bool ScheduleParentAndGrandparentForDeletion(const base::FilePath& path) {

Powered by Google App Engine
This is Rietveld 408576698