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

Side by Side Diff: base/win/shortcut.h

Issue 108193019: Installer: adding ResolveShortcutProperties(); updating shortcut icons during shortcut migration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding ResolveShortcutProperties() to read thumbnails; requiring old target to matchs icon to for i… Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/win/shortcut.cc » ('j') | base/win/shortcut.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_WIN_SHORTCUT_H_ 5 #ifndef BASE_WIN_SHORTCUT_H_
6 #define BASE_WIN_SHORTCUT_H_ 6 #define BASE_WIN_SHORTCUT_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // Ensure you have initialized COM before calling into this function. 111 // Ensure you have initialized COM before calling into this function.
112 // |operation|: a choice from the ShortcutOperation enum. 112 // |operation|: a choice from the ShortcutOperation enum.
113 // If |operation| is SHORTCUT_REPLACE_EXISTING or SHORTCUT_UPDATE_EXISTING and 113 // If |operation| is SHORTCUT_REPLACE_EXISTING or SHORTCUT_UPDATE_EXISTING and
114 // |shortcut_path| does not exist, this method is a no-op and returns false. 114 // |shortcut_path| does not exist, this method is a no-op and returns false.
115 BASE_EXPORT bool CreateOrUpdateShortcutLink( 115 BASE_EXPORT bool CreateOrUpdateShortcutLink(
116 const FilePath& shortcut_path, 116 const FilePath& shortcut_path,
117 const ShortcutProperties& properties, 117 const ShortcutProperties& properties,
118 ShortcutOperation operation); 118 ShortcutOperation operation);
119 119
120 // Resolve Windows shortcut (.LNK file) 120 // Resolve Windows shortcut (.LNK file)
121 // This methods tries to resolve a shortcut .LNK file. The path of the shortcut 121 // This methods tries to resolve selected properties of a shortcut .LNK file.
122 // to resolve is in |shortcut_path|. If |target_path| is not NULL, the target 122 // The path of the shortcut to resolve is in |shortcut_path|. |options| is a bit
123 // will be resolved and placed in |target_path|. If |args| is not NULL, the 123 // field composed of ShortcutProperties::IndividualProperties, to specify which
124 // arguments will be retrieved and placed in |args|. The function returns true 124 // properties to read. The resulting data are read into |p| (non-NULL). The
125 // if all requested fields are found successfully. 125 // function returns true if all requested properties are successfully read.
126 // Otherwise some reads have failed, and intermediate values written to
127 // |properties| should be ignored.
128 BASE_EXPORT bool ResolveShortcutProperties(const FilePath& shortcut_path,
129 uint32 options,
130 ShortcutProperties* p);
131
132 // Resolve Windows shortcut (.LNK file).
133 // This is a wrapper to ResolveShortcutProperties() to handle the commonly used
134 // cases of resolving target and arguments. |target_path| and |args| are
135 // optional output variables that are ignored if NULL.
136 // The function returns true if all requested fields are found successfully.
126 // Callers can safely use the same variable for both |shortcut_path| and 137 // Callers can safely use the same variable for both |shortcut_path| and
127 // |target_path|. 138 // |target_path|.
128 BASE_EXPORT bool ResolveShortcut(const FilePath& shortcut_path, 139 BASE_EXPORT bool ResolveShortcut(const FilePath& shortcut_path,
129 FilePath* target_path, 140 FilePath* target_path,
130 string16* args); 141 string16* args);
131 142
132 // Pins a shortcut to the Windows 7 taskbar. The shortcut file must already 143 // Pins a shortcut to the Windows 7 taskbar. The shortcut file must already
133 // exist and be a shortcut that points to an executable. The app id of the 144 // exist and be a shortcut that points to an executable. The app id of the
134 // shortcut is used to group windows and must be set correctly. 145 // shortcut is used to group windows and must be set correctly.
135 BASE_EXPORT bool TaskbarPinShortcutLink(const wchar_t* shortcut); 146 BASE_EXPORT bool TaskbarPinShortcutLink(const wchar_t* shortcut);
136 147
137 // Unpins a shortcut from the Windows 7 taskbar. The shortcut must exist and 148 // Unpins a shortcut from the Windows 7 taskbar. The shortcut must exist and
138 // already be pinned to the taskbar. The app id of the shortcut is used as the 149 // already be pinned to the taskbar. The app id of the shortcut is used as the
139 // identifier for the taskbar item to remove and must be set correctly. 150 // identifier for the taskbar item to remove and must be set correctly.
140 BASE_EXPORT bool TaskbarUnpinShortcutLink(const wchar_t* shortcut); 151 BASE_EXPORT bool TaskbarUnpinShortcutLink(const wchar_t* shortcut);
141 152
142 } // namespace win 153 } // namespace win
143 } // namespace base 154 } // namespace base
144 155
145 #endif // BASE_WIN_SHORTCUT_H_ 156 #endif // BASE_WIN_SHORTCUT_H_
OLDNEW
« no previous file with comments | « no previous file | base/win/shortcut.cc » ('j') | base/win/shortcut.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698