Chromium Code Reviews| Index: base/win/shortcut.h |
| diff --git a/base/win/shortcut.h b/base/win/shortcut.h |
| index 0f5fb0f686be84e521f8ee403a5a3b903053c353..ae6ee310df0c5036cc8348514de3ba9603ff5004 100644 |
| --- a/base/win/shortcut.h |
| +++ b/base/win/shortcut.h |
| @@ -31,15 +31,24 @@ enum ShortcutOperation { |
| // setting |options| as desired. |
| struct ShortcutProperties { |
| enum IndividualProperties { |
| - PROPERTIES_TARGET = 1 << 0, |
| - PROPERTIES_WORKING_DIR = 1 << 1, |
| - PROPERTIES_ARGUMENTS = 1 << 2, |
| - PROPERTIES_DESCRIPTION = 1 << 3, |
| - PROPERTIES_ICON = 1 << 4, |
| - PROPERTIES_APP_ID = 1 << 5, |
| - PROPERTIES_DUAL_MODE = 1 << 6, |
| + PROPERTIES_TARGET = 1U << 0, |
| + PROPERTIES_WORKING_DIR = 1U << 1, |
| + PROPERTIES_ARGUMENTS = 1U << 2, |
| + PROPERTIES_DESCRIPTION = 1U << 3, |
| + PROPERTIES_ICON = 1U << 4, |
| + PROPERTIES_APP_ID = 1U << 5, |
| + PROPERTIES_DUAL_MODE = 1U << 6, |
| + // Be sure to update the values below when adding a new property. |
| + PROPERTIES_BASIC = PROPERTIES_TARGET | |
| + PROPERTIES_WORKING_DIR | |
| + PROPERTIES_ARGUMENTS | |
| + PROPERTIES_DESCRIPTION | |
| + PROPERTIES_ICON, |
| + PROPERTIES_WIN7 = PROPERTIES_APP_ID | PROPERTIES_DUAL_MODE, |
| + PROPERTIES_ALL = PROPERTIES_BASIC | PROPERTIES_WIN7 |
| }; |
|
gab
2014/01/03 18:25:52
Remove extra empty line.
huangs
2014/01/03 20:19:35
Done.
|
| + |
| ShortcutProperties() : icon_index(-1), dual_mode(false), options(0U) {} |
| void set_target(const FilePath& target_in) { |
| @@ -117,14 +126,25 @@ BASE_EXPORT bool CreateOrUpdateShortcutLink( |
| const ShortcutProperties& properties, |
| ShortcutOperation operation); |
| -// Resolve Windows shortcut (.LNK file) |
| -// This methods tries to resolve a shortcut .LNK file. The path of the shortcut |
| -// to resolve is in |shortcut_path|. If |target_path| is not NULL, the target |
| -// will be resolved and placed in |target_path|. If |args| is not NULL, the |
| -// arguments will be retrieved and placed in |args|. The function returns true |
| -// if all requested fields are found successfully. |
| -// Callers can safely use the same variable for both |shortcut_path| and |
| -// |target_path|. |
| +// Resolves Windows shortcut (.LNK file) |
| +// This methods tries to resolve selected properties of a shortcut .LNK file. |
| +// The path of the shortcut to resolve is in |shortcut_path|. |options| is a bit |
| +// field composed of ShortcutProperties::IndividualProperties, to specify which |
| +// properties to read. It should be non-0. The resulting data are read into |
| +// |properties|, which must not be NULL. The function returns true if all |
| +// requested properties are successfully read. Otherwise some reads have failed |
| +// and intermediate values written to |properties| should be ignored. |
| +BASE_EXPORT bool ResolveShortcutProperties(const FilePath& shortcut_path, |
| + uint32 options, |
| + ShortcutProperties* properties); |
| + |
| +// Resolves Windows shortcut (.LNK file). |
| +// This is a wrapper to ResolveShortcutProperties() to handle the common use |
| +// case of resolving target and arguments. |target_path| and |args| are |
| +// optional output variables that are ignored if NULL (but at least one must be |
| +// non-NULL). The function returns true if all requested fields are found |
| +// successfully. Callers can safely use the same variable for both |
| +// |shortcut_path| and |target_path|. |
| BASE_EXPORT bool ResolveShortcut(const FilePath& shortcut_path, |
| FilePath* target_path, |
| string16* args); |