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

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

Issue 13864015: Move app launcher and chrome apps shortcut strings into the installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_app_id_fix
Patch Set: fix linux Created 7 years, 2 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 473c3bb9b5a92f9744cfc7d4a54ec0372588398e..ecd072a7534e440bfdee18f6dd6efdd97c5f6105 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -345,40 +345,17 @@ void RetargetUserShortcutsWithArgs(const InstallerState& installer_state,
ShellUtil::ShortcutProperties updated_properties(install_level);
updated_properties.set_target(new_target_exe);
- // TODO(huangs): Make this data-driven, along with DeleteShortcuts().
- VLOG(1) << "Retargeting Desktop shortcuts.";
- if (!ShellUtil::UpdateShortcutsWithArgs(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist, install_level,
- old_target_exe, updated_properties)) {
- LOG(WARNING) << "Failed to retarget Desktop shortcuts.";
- }
-
- VLOG(1) << "Retargeting Quick Launch shortcuts.";
- if (!ShellUtil::UpdateShortcutsWithArgs(
- ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist, install_level,
- old_target_exe, updated_properties)) {
- LOG(WARNING) << "Failed to retarget Quick Launch shortcuts.";
- }
-
- VLOG(1) << "Retargeting Start Menu shortcuts.";
- if (!ShellUtil::UpdateShortcutsWithArgs(
- ShellUtil::SHORTCUT_LOCATION_START_MENU, dist, install_level,
- old_target_exe, updated_properties)) {
- LOG(WARNING) << "Failed to retarget Start Menu shortcuts.";
- }
-
- // Retarget pinned-to-taskbar shortcuts that point to |chrome_exe|.
- if (!ShellUtil::UpdateShortcutsWithArgs(
- ShellUtil::SHORTCUT_LOCATION_TASKBAR_PINS, dist,
- ShellUtil::CURRENT_USER, old_target_exe, updated_properties)) {
- LOG(WARNING) << "Failed to retarget taskbar shortcuts at user-level.";
- }
-
- // Retarget the folder of secondary tiles from the start screen for |dist|.
- if (!ShellUtil::UpdateShortcutsWithArgs(
- ShellUtil::SHORTCUT_LOCATION_APP_SHORTCUTS, dist, install_level,
- old_target_exe, updated_properties)) {
- LOG(WARNING) << "Failed to retarget start-screen shortcuts.";
+ // Retarget all shortcuts that point to |old_target_exe| from all
+ // ShellUtil::ShortcutLocations.
+ VLOG(1) << "Retargeting shortcuts.";
+ for (int location = ShellUtil::SHORTCUT_LOCATION_START;
grt (UTC plus 2) 2013/10/22 13:37:45 if you use ShellUtil::ShortcutLocation rather than
gab 2013/10/22 17:07:29 Yes, but then you can't use ++ (enums are not iter
grt (UTC plus 2) 2013/10/22 18:08:07 agreed. i haven't been writing code enough recentl
+ location != ShellUtil::SHORTCUT_LOCATION_END; ++location) {
+ if (!ShellUtil::UpdateShortcutsWithArgs(
+ static_cast<ShellUtil::ShortcutLocation>(location), dist,
+ install_level, old_target_exe, updated_properties)) {
+ LOG(WARNING) << "Failed to retarget shortcuts with ShortcutLocation:"
huangs 2013/10/17 19:13:35 NIT: Space after ":".
grt (UTC plus 2) 2013/10/22 13:37:45 nit: "with" -> "in"
calamity 2013/11/20 05:43:30 Done.
calamity 2013/11/20 05:43:30 Done.
+ << location;
+ }
}
}
@@ -395,22 +372,17 @@ void DeleteShortcuts(const InstallerState& installer_state,
ShellUtil::ShellChange install_level = installer_state.system_install() ?
ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER;
- 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 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::RemoveShortcuts(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist,
- install_level, target_exe)) {
- LOG(WARNING) << "Failed to delete Start Menu shortcuts.";
+ // Delete and unpin all shortcuts that point to |target_exe| from all
+ // ShellUtil::ShortcutLocations.
+ VLOG(1) << "Deleting shortcuts.";
+ for (int location = ShellUtil::SHORTCUT_LOCATION_START;
grt (UTC plus 2) 2013/10/22 13:37:45 int -> ShellUtil::ShortcutLocation
gab 2013/10/22 17:07:29 Same here.
calamity 2013/11/20 05:43:30 Done.
calamity 2013/11/20 05:43:30 Done.
+ location != ShellUtil::SHORTCUT_LOCATION_END; ++location) {
+ if (!ShellUtil::RemoveShortcuts(
+ static_cast<ShellUtil::ShortcutLocation>(location), dist,
+ install_level, target_exe)) {
+ LOG(WARNING) << "Failed to delete shortcuts with ShortcutLocation:"
huangs 2013/10/17 19:13:35 NIT: Space after ":".
grt (UTC plus 2) 2013/10/22 13:37:45 nit: "with" -> "in"
gab 2013/10/22 17:07:29 Given this is the ID of the shortcut location I th
calamity 2013/11/20 05:43:30 Done.
+ << location;
+ }
}
// Unpin all pinned-to-taskbar shortcuts that point to |chrome_exe|.
@@ -418,12 +390,6 @@ void DeleteShortcuts(const InstallerState& installer_state,
dist, ShellUtil::CURRENT_USER, target_exe)) {
LOG(WARNING) << "Failed to unpin taskbar shortcuts at user-level.";
}
-
- // Delete the folder of secondary tiles from the start screen for |dist|.
- if (!ShellUtil::RemoveShortcuts(ShellUtil::SHORTCUT_LOCATION_APP_SHORTCUTS,
- dist, install_level, target_exe)) {
- LOG(WARNING) << "Failed to delete start-screen shortcuts.";
- }
}
bool ScheduleParentAndGrandparentForDeletion(const base::FilePath& path) {

Powered by Google App Engine
This is Rietveld 408576698