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

Unified Diff: chrome/installer/util/shell_util.h

Issue 14287008: Refactoring installer shortcut deletion; adding dedicated shortcut update feature. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed redundant routines; cleaning up interfaces, including fixing callers. 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/util/shell_util.h
diff --git a/chrome/installer/util/shell_util.h b/chrome/installer/util/shell_util.h
index bfdb9b953ecfeec05bd2c918e40e8096246a7b16..d00479c454a531113f8f4b1cd44abb51b93fb6e7 100644
--- a/chrome/installer/util/shell_util.h
+++ b/chrome/installer/util/shell_util.h
@@ -44,6 +44,8 @@ class ShellUtil {
SHORTCUT_LOCATION_DESKTOP,
SHORTCUT_LOCATION_QUICK_LAUNCH,
SHORTCUT_LOCATION_START_MENU,
+ SHORTCUT_LOCATION_TASKBAR_PINS, // base::win::VERSION_WIN7 +
+ SHORTCUT_LOCATION_APP_SHORTCUTS, // base::win::VERSION_WIN8 +
};
enum ShortcutOperation {
@@ -498,12 +500,10 @@ class ShellUtil {
bool elevate_if_not_admin);
// Removes installed shortcut(s) at |location|.
- // |target_exe|: Shortcut target exe; shortcuts will only be deleted when
- // their target is |target_exe|.
// |level|: CURRENT_USER to remove the per-user shortcut and SYSTEM_LEVEL to
grt (UTC plus 2) 2013/04/30 14:38:07 and -> or
huangs 2013/04/30 15:58:38 Done.
// remove the all-users shortcut.
- // |shortcut_name|: If non-null, remove the shortcut named |shortcut_name| at
- // location; otherwise remove all shortcuts to |target_exe| at |location|.
+ // |target_exe|: Shortcut target exe; shortcuts will only be deleted when
+ // their target is |target_exe|.
// If |location| is SHORTCUT_LOCATION_START_MENU, the shortcut folder specific
// to |dist| is deleted.
// Also attempts to unpin the removed shortcut(s) from the taskbar.
@@ -511,20 +511,27 @@ class ShellUtil {
// none at |location| pointing to |target_exe|).
static bool RemoveShortcut(ShellUtil::ShortcutLocation location,
grt (UTC plus 2) 2013/04/30 14:38:07 RemoveShortcut -> RemoveShortcuts
huangs 2013/04/30 15:58:38 Done.
BrowserDistribution* dist,
- const base::FilePath& target_exe,
ShellChange level,
- const string16* shortcut_name);
-
- // Enumerates all shortcuts pinned to the taskbar and deletes those pointing
- // to |target_exe|.
- // base::win::TaskbarUnpinShortcutLink() should be prefered, but this is
- // useful on uninstall as the parent shortcut of a pin might no longer exist
- // (thus making it impossible to unpin it via that API).
- static void RemoveTaskbarShortcuts(const string16& target_exe);
+ const base::FilePath& target_exe);
- // This will remove all secondary tiles from the start screen for |dist|.
+ // Remove all secondary tiles with target set to |target_exe| from the
+ // start screen for |dist|.
static void RemoveStartScreenShortcuts(BrowserDistribution* dist,
- const string16& target_exe);
+ const base::FilePath& target_exe);
+
+ // Traverses through installed shortcut(s) in a similar manner as
+ // RemoveShortcut(). For each matched shortcut to |old_target_exe|,
+ // update the shortcut so that it points to |new_target_exe|.
+ static bool MigrateShortcut(ShellUtil::ShortcutLocation location,
grt (UTC plus 2) 2013/04/30 14:38:07 "Migrate" is very generic. Since this updates the
huangs 2013/04/30 15:58:38 Using "Retarget". :)
+ BrowserDistribution* dist,
+ ShellChange level,
+ const base::FilePath& old_target_exe,
+ const base::FilePath& new_target_exe);
+
+ // Similar to RemoveStartScreenShortcuts(), but performs migration.
grt (UTC plus 2) 2013/04/30 14:38:07 Same comment about "migrate" here in comment and m
huangs 2013/04/30 15:58:38 Done.
+ static void MigrateStartScreenShortcuts(BrowserDistribution* dist,
grt (UTC plus 2) 2013/04/30 14:38:07 this doesn't appear to ever be called. why is it i
huangs 2013/04/30 15:58:38 This CL is intended for immediate use by: https://
grt (UTC plus 2) 2013/04/30 19:59:53 I don't see MigrateStartScreenShortcuts being used
+ const base::FilePath& old_target_exe,
+ const base::FilePath& new_target_exe);
// Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid
// preceded by a dot.

Powered by Google App Engine
This is Rietveld 408576698