summaryrefslogtreecommitdiffstats
path: root/base/win/shortcut.h
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 05:51:52 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 05:51:52 +0000
commit35e55c701b89e06d1ad75ecbe7420961e2f43670 (patch)
tree5571044fa9c72d7034812cb7c8008b5689aecb10 /base/win/shortcut.h
parente5ea93b54f4159a75df435115e9962d8c6c50314 (diff)
downloadchromium_src-35e55c701b89e06d1ad75ecbe7420961e2f43670.zip
chromium_src-35e55c701b89e06d1ad75ecbe7420961e2f43670.tar.gz
chromium_src-35e55c701b89e06d1ad75ecbe7420961e2f43670.tar.bz2
Introduce the SHORTCUT_REPLACE_EXISTING operation to be used when the desire is to overwrite the shortcut completely (i.e. like SHORTCUT_CREATE_ALWAYS), but only if it exists already.
In this line of thought, SHORTCUT_UPDATE_EXISTING should now only be used when the desire is to update a subset of the properties without affecting other properties currently set on the shortcut. The two current uses of SHORTCUT_UPDATE_EXISTING at http://108.166.104.54/xref/chromium/src/chrome/browser/ui/web_applications/web_app_ui.cc#275 and http://108.166.104.54/xref/chromium/src/chrome/browser/shell_integration_win.cc#343 The other uses in the installer are not, but I will change this as part of my big ShellUtil CL coming up. BUG=148539 TEST=base_unittests.exe --gtest_filter=ShortcutTest* Review URL: https://chromiumcodereview.appspot.com/10965053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/win/shortcut.h')
-rw-r--r--base/win/shortcut.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/base/win/shortcut.h b/base/win/shortcut.h
index edd800e..af23b29 100644
--- a/base/win/shortcut.h
+++ b/base/win/shortcut.h
@@ -17,7 +17,9 @@ namespace win {
enum ShortcutOperation {
// Create a new shortcut (overwriting if necessary).
SHORTCUT_CREATE_ALWAYS = 0,
- // Update specified (non-null) properties only on an existing shortcut.
+ // Overwrite an existing shortcut (fails if the shortcut doesn't exist).
+ SHORTCUT_REPLACE_EXISTING,
+ // Update specified properties only on an existing shortcut.
SHORTCUT_UPDATE_EXISTING,
};
@@ -106,8 +108,8 @@ struct ShortcutProperties {
// information given through |properties|.
// Ensure you have initialized COM before calling into this function.
// |operation|: a choice from the ShortcutOperation enum.
-// If |operation| is SHORTCUT_UPDATE_EXISTING and |shortcut_path| does not
-// exist, this method is a no-op and returns false.
+// If |operation| is SHORTCUT_REPLACE_EXISTING or SHORTCUT_UPDATE_EXISTING and
+// |shortcut_path| does not exist, this method is a no-op and returns false.
BASE_EXPORT bool CreateOrUpdateShortcutLink(
const FilePath& shortcut_path,
const ShortcutProperties& properties,