summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 02:46:08 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 02:46:08 +0000
commitcfc84156401287b783f439024f61c8a477087362 (patch)
treec1c075451c8de0c843888c6b0726026a225eda61 /chrome/installer/setup
parent0e8e65cecc6a817e42203a99e3719e69a02a4a57 (diff)
downloadchromium_src-cfc84156401287b783f439024f61c8a477087362.zip
chromium_src-cfc84156401287b783f439024f61c8a477087362.tar.gz
chromium_src-cfc84156401287b783f439024f61c8a477087362.tar.bz2
installer_util_unittests has failed on XP Tests (dbg)(1) since this landed
Revert 155869 - Refactoring and tests for the highly undertested file_util::CreateOrUpdateShortcutLink() method. Simplify file_util::CreateOrUpdateShortcutLink()'s interface (use a struct to set parameters passed which allows callers to specify exactly what they want without having to pass in a bunch of NULLs for the unused parameters). The same concept will be used for ShellUtil's shortcut functions in an upcoming CL. Moved ShellUtil::VerifyChromeShortcut() to file_util::VerifyShortcut() and augmented it for every shortcut properties. This will also allow other shortcut creators (web apps, profiles, etc.) to have a broader test coverage on the shortcut they create (i.e. more testable properties available). I will leave it up to the owners of these various projects to augment their tests, this CL keeps the previously tested behavior, not more, not less. This is the 1st CL of a massive refactoring effort for shortcuts (http://goo.gl/Az889) in which ShellUtil's shortcut methods have to be refactored (http://codereview.chromium.org/10836247/ : soon to incorporate interface changes from this CL) which led me even lower to first refactor file_util's shortcut methods. BUG=132825 TEST=base_unittests --gtest_filter=FileUtilShortcutTest* installer_util_unitests --gtest_filter=ShellUtilTestWithDirAndDist* unit_tests --gtest_filter=ProfileShortcutManagerTest* Review URL: https://chromiumcodereview.appspot.com/10914109 TBR=gab@chromium.org Review URL: https://chromiumcodereview.appspot.com/10910183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/install.cc17
-rw-r--r--chrome/installer/setup/uninstall.cc3
2 files changed, 8 insertions, 12 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 82e13fb..05efc3c 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -17,7 +17,6 @@
#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"
@@ -310,7 +309,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 (!base::win::TaskbarPinShortcutLink(chrome_link.value().c_str())) {
+ if (!file_util::TaskbarPinShortcutLink(chrome_link.value().c_str())) {
LOG(ERROR) << "Failed to pin shortcut to taskbar: "
<< chrome_link.value();
}
@@ -328,14 +327,12 @@ void CreateOrUpdateStartMenuAndTaskbarShortcuts(
CommandLine arguments(CommandLine::NO_PROGRAM);
AppendUninstallCommandLineFlags(installer_state, product, &arguments);
VLOG(1) << operation << " uninstall link at " << uninstall_link.value();
- 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)) {
+ 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)) {
LOG(WARNING) << operation << " uninstall link at "
<< uninstall_link.value() << " failed.";
}
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 20fc91f..a73a7f6 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -19,7 +19,6 @@
#include "base/utf_string_conversions.h"
#include "base/win/registry.h"
#include "base/win/scoped_handle.h"
-#include "base/win/shortcut.h"
#include "base/win/windows_version.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h"
@@ -308,7 +307,7 @@ void DeleteChromeShortcuts(const InstallerState& installer_state,
VLOG(1) << "Unpinning shortcut at " << shortcut_link.value()
<< " from taskbar";
// Ignore return value: keep uninstalling if the unpin fails.
- base::win::TaskbarUnpinShortcutLink(shortcut_link.value().c_str());
+ file_util::TaskbarUnpinShortcutLink(shortcut_link.value().c_str());
VLOG(1) << "Deleting shortcut " << shortcut_path.value();
if (!file_util::Delete(shortcut_path, true))