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

Unified Diff: base/file_util_win.cc

Issue 10889028: Install a user-level Start Menu shortcut for every user on system-installs through Active Setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove TODO for Notify Created 8 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/installer/setup/install.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index b88e13169e8993db2ba2ebb48bd1090cbf355c3f..390aa5f5d084bc28669299ac871a05e81a94cba5 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -446,17 +446,22 @@ 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
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
Sigurður Ásgeirsson 2012/09/10 18:52:32 Is it not sufficient here to so SHCNE_UPDATEITEM w
}
- return SUCCEEDED(result);
+ return succeeded;
}
bool TaskbarPinShortcutLink(const wchar_t* shortcut) {
« no previous file with comments | « no previous file | chrome/installer/setup/install.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698