OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file contains utility functions for dealing with the local | 5 // This file contains utility functions for dealing with the local |
6 // filesystem. | 6 // filesystem. |
7 | 7 |
8 #ifndef BASE_FILE_UTIL_H_ | 8 #ifndef BASE_FILE_UTIL_H_ |
9 #define BASE_FILE_UTIL_H_ | 9 #define BASE_FILE_UTIL_H_ |
10 | 10 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // false leaving the path as it is. | 211 // false leaving the path as it is. |
212 bool ResolveShortcut(FilePath* path); | 212 bool ResolveShortcut(FilePath* path); |
213 | 213 |
214 // Create a Windows shortcut (.LNK file) | 214 // Create a Windows shortcut (.LNK file) |
215 // This method creates a shortcut link using the information given. Ensure | 215 // This method creates a shortcut link using the information given. Ensure |
216 // you have initialized COM before calling into this function. 'source' | 216 // you have initialized COM before calling into this function. 'source' |
217 // and 'destination' parameters are required, everything else can be NULL. | 217 // and 'destination' parameters are required, everything else can be NULL. |
218 // 'source' is the existing file, 'destination' is the new link file to be | 218 // 'source' is the existing file, 'destination' is the new link file to be |
219 // created; for best results pass the filename with the .lnk extension. | 219 // created; for best results pass the filename with the .lnk extension. |
220 // The 'icon' can specify a dll or exe in which case the icon index is the | 220 // The 'icon' can specify a dll or exe in which case the icon index is the |
221 // resource id. | 221 // resource id. 'app_id' is the app model id for the shortcut on Win7. |
222 // Note that if the shortcut exists it will overwrite it. | 222 // Note that if the shortcut exists it will overwrite it. |
223 bool CreateShortcutLink(const wchar_t *source, const wchar_t *destination, | 223 bool CreateShortcutLink(const wchar_t *source, const wchar_t *destination, |
224 const wchar_t *working_dir, const wchar_t *arguments, | 224 const wchar_t *working_dir, const wchar_t *arguments, |
225 const wchar_t *description, const wchar_t *icon, | 225 const wchar_t *description, const wchar_t *icon, |
226 int icon_index); | 226 int icon_index, const wchar_t* app_id); |
227 | 227 |
228 // Update a Windows shortcut (.LNK file). This method assumes the shortcut | 228 // Update a Windows shortcut (.LNK file). This method assumes the shortcut |
229 // link already exists (otherwise false is returned). Ensure you have | 229 // link already exists (otherwise false is returned). Ensure you have |
230 // initialized COM before calling into this function. Only 'destination' | 230 // initialized COM before calling into this function. Only 'destination' |
231 // parameter is required, everything else can be NULL (but if everything else | 231 // parameter is required, everything else can be NULL (but if everything else |
232 // is NULL no changes are made to the shortcut). 'destination' is the link | 232 // is NULL no changes are made to the shortcut). 'destination' is the link |
233 // file to be updated. For best results pass the filename with the .lnk | 233 // file to be updated. 'app_id' is the app model id for the shortcut on Win7. |
234 // extension. | 234 // For best results pass the filename with the .lnk extension. |
235 bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, | 235 bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, |
236 const wchar_t *working_dir, const wchar_t *arguments, | 236 const wchar_t *working_dir, const wchar_t *arguments, |
237 const wchar_t *description, const wchar_t *icon, | 237 const wchar_t *description, const wchar_t *icon, |
238 int icon_index); | 238 int icon_index, const wchar_t* app_id); |
239 | 239 |
240 // Pins a shortcut to the Windows 7 taskbar. The shortcut file must already | 240 // Pins a shortcut to the Windows 7 taskbar. The shortcut file must already |
241 // exist and be a shortcut that points to an executable. | 241 // exist and be a shortcut that points to an executable. |
242 bool TaskbarPinShortcutLink(const wchar_t* shortcut); | 242 bool TaskbarPinShortcutLink(const wchar_t* shortcut); |
243 | 243 |
244 // Unpins a shortcut from the Windows 7 taskbar. The shortcut must exist and | 244 // Unpins a shortcut from the Windows 7 taskbar. The shortcut must exist and |
245 // already be pinned to the taskbar. | 245 // already be pinned to the taskbar. |
246 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut); | 246 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut); |
247 | 247 |
248 // Return true if the given directory is empty | 248 // Return true if the given directory is empty |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 // Renames a file using the SHFileOperation API to ensure that the target file | 533 // Renames a file using the SHFileOperation API to ensure that the target file |
534 // gets the correct default security descriptor in the new path. | 534 // gets the correct default security descriptor in the new path. |
535 bool RenameFileAndResetSecurityDescriptor( | 535 bool RenameFileAndResetSecurityDescriptor( |
536 const FilePath& source_file_path, | 536 const FilePath& source_file_path, |
537 const FilePath& target_file_path); | 537 const FilePath& target_file_path); |
538 | 538 |
539 } // namespace file_util | 539 } // namespace file_util |
540 | 540 |
541 #endif // BASE_FILE_UTIL_H_ | 541 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |