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

Unified Diff: chrome/installer/setup/install.cc

Issue 10914109: Refactoring and tests for the highly undertested file_util::CreateOrUpdateShortcutLink() method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: namespace s/Win/win 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 | « chrome/browser/web_applications/web_app_win.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install.cc
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 05efc3c7c7f792a5808ab190cdb4f8e7ae76c0f0..82e13fb69891498150fb353b8df7adf85b4a308e 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -17,6 +17,7 @@
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
+#include "base/win/shortcut.h"
#include "base/win/windows_version.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/installer/setup/setup_constants.h"
@@ -309,7 +310,7 @@ void CreateOrUpdateStartMenuAndTaskbarShortcuts(
// proceed to pin the Start Menu shortcut to the taskbar on Win7+.
VLOG(1) << "Pinning new shortcut at " << chrome_link.value()
<< " to taskbar";
- if (!file_util::TaskbarPinShortcutLink(chrome_link.value().c_str())) {
+ if (!base::win::TaskbarPinShortcutLink(chrome_link.value().c_str())) {
LOG(ERROR) << "Failed to pin shortcut to taskbar: "
<< chrome_link.value();
}
@@ -327,12 +328,14 @@ void CreateOrUpdateStartMenuAndTaskbarShortcuts(
CommandLine arguments(CommandLine::NO_PROGRAM);
AppendUninstallCommandLineFlags(installer_state, product, &arguments);
VLOG(1) << operation << " uninstall link at " << uninstall_link.value();
- if (!file_util::CreateOrUpdateShortcutLink(setup_exe.value().c_str(),
- uninstall_link.value().c_str(), NULL,
- arguments.GetCommandLineString().c_str(), NULL,
- setup_exe.value().c_str(), 0, NULL,
- create_always ? file_util::SHORTCUT_CREATE_ALWAYS :
- file_util::SHORTCUT_NO_OPTIONS)) {
+ base::win::ShortcutProperties shortcut_properties;
+ shortcut_properties.set_target(setup_exe);
+ shortcut_properties.set_arguments(arguments.GetCommandLineString());
+ shortcut_properties.set_icon(setup_exe, 0);
+ if (!base::win::CreateOrUpdateShortcutLink(
+ uninstall_link, shortcut_properties,
+ create_always ? base::win::SHORTCUT_CREATE_ALWAYS :
+ base::win::SHORTCUT_UPDATE_EXISTING)) {
LOG(WARNING) << operation << " uninstall link at "
<< uninstall_link.value() << " failed.";
}
« no previous file with comments | « chrome/browser/web_applications/web_app_win.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698