| Index: base/file_util_win.cc
|
| diff --git a/base/file_util_win.cc b/base/file_util_win.cc
|
| index b88e13169e8993db2ba2ebb48bd1090cbf355c3f..1d4ad9db5064c16274384e3439d528603d873225 100644
|
| --- a/base/file_util_win.cc
|
| +++ b/base/file_util_win.cc
|
| @@ -446,17 +446,25 @@ bool CreateOrUpdateShortcutLink(const wchar_t *source,
|
|
|
| HRESULT result = i_persist_file->Save(destination, TRUE);
|
|
|
| - // If we successfully updated the icon, notify the shell that we have done so.
|
| - if (!create && SUCCEEDED(result)) {
|
| - // Release the interfaces in case the SHChangeNotify call below depends on
|
| - // the operations above being fully completed.
|
| - i_persist_file.Release();
|
| - i_shell_link.Release();
|
| -
|
| - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
| + // Release the interfaces in case the SHChangeNotify call below depends on
|
| + // the operations above being fully completed.
|
| + i_persist_file.Release();
|
| + i_shell_link.Release();
|
| +
|
| + // If we successfully created/updated the icon, notify the shell that we have
|
| + // done so.
|
| + const bool succeeded = SUCCEEDED(result);
|
| + if (succeeded) {
|
| + if (create) {
|
| + SHChangeNotify(SHCNE_CREATE, SHCNF_PATH, destination, NULL);
|
| + } else {
|
| + // TODO(gab): Only use SHCNE_ASSOCCHANGED when the icon changed.
|
| + // Otherwise a simple SHCNE_UPDATEITEM should be sufficient.
|
| + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
| + }
|
| }
|
|
|
| - return SUCCEEDED(result);
|
| + return succeeded;
|
| }
|
|
|
| bool TaskbarPinShortcutLink(const wchar_t* shortcut) {
|
|
|