summaryrefslogtreecommitdiff
path: root/chrome/installer
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-08-19 13:00:08 +0100
committerTorne (Richard Coles) <torne@google.com>2014-08-19 13:00:08 +0100
commit6e8cce623b6e4fe0c9e4af605d675dd9d0338c38 (patch)
tree8d824ad26fac42e008142b86aa9631b2be7e4705 /chrome/installer
parent4f7316adb45db5ec3c9c1181ba9510c004566df8 (diff)
downloadchromium_org-6e8cce623b6e4fe0c9e4af605d675dd9d0338c38.tar.gz
Merge from Chromium at DEPS revision 290040
This commit was generated by merge_to_master.py. Change-Id: I694ec52d1e0b553f163c2faf4373d63270ab1aac
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/gcapi/gcapi.cc7
-rw-r--r--chrome/installer/setup/install.cc13
-rw-r--r--chrome/installer/setup/install_unittest.cc25
-rw-r--r--chrome/installer/util/google_update_settings.h2
-rw-r--r--chrome/installer/util/language_selector.cc2
-rw-r--r--chrome/installer/util/shell_util.cc19
-rw-r--r--chrome/installer/util/shell_util_unittest.cc24
7 files changed, 43 insertions, 49 deletions
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
index 0606988ab8..7253935521 100644
--- a/chrome/installer/gcapi/gcapi.cc
+++ b/chrome/installer/gcapi/gcapi.cc
@@ -503,18 +503,21 @@ BOOL __stdcall LaunchGoogleChrome() {
}
}
+ CommandLine chrome_command(chrome_exe_path);
+
bool ret = false;
ScopedComPtr<IProcessLauncher> ipl;
if (SUCCEEDED(ipl.CreateInstance(__uuidof(ProcessLauncherClass),
NULL,
CLSCTX_LOCAL_SERVER))) {
- if (SUCCEEDED(ipl->LaunchCmdLine(chrome_exe_path.value().c_str())))
+ if (SUCCEEDED(ipl->LaunchCmdLine(
+ chrome_command.GetCommandLineString().c_str())))
ret = true;
ipl.Release();
} else {
// Couldn't get Omaha's process launcher, Omaha may not be installed at
// system level. Try just running Chrome instead.
- ret = base::LaunchProcess(chrome_exe_path.value(),
+ ret = base::LaunchProcess(chrome_command.GetCommandLineString(),
base::LaunchOptions(),
NULL);
}
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 5ba2608766..f1ab38dab8 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -244,11 +244,8 @@ installer::InstallStatus InstallNewVersion(
return installer::INSTALL_FAILED;
}
-// Deletes the old "Uninstall Google Chrome" shortcut in the Start menu and, if
-// this is a system-level install, also deletes the old Default user Quick
-// Launch shortcut. Both of these were created prior to Chrome 24; in Chrome 24,
-// the uninstall shortcut was removed and the Default user Quick Launch shortcut
-// was replaced by per-user shortcuts created via Active Setup.
+// Deletes the old "Uninstall Google Chrome" shortcut in the Start menu which
+// was installed prior to Chrome 24.
void CleanupLegacyShortcuts(const installer::InstallerState& installer_state,
BrowserDistribution* dist,
const base::FilePath& chrome_exe) {
@@ -260,12 +257,6 @@ void CleanupLegacyShortcuts(const installer::InstallerState& installer_state,
uninstall_shortcut_path = uninstall_shortcut_path.Append(
dist->GetUninstallLinkName() + installer::kLnkExt);
base::DeleteFile(uninstall_shortcut_path, false);
-
- if (installer_state.system_install()) {
- ShellUtil::RemoveShortcuts(
- ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist,
- ShellUtil::SYSTEM_LEVEL, chrome_exe);
- }
}
// Returns the appropriate shortcut operations for App Launcher,
diff --git a/chrome/installer/setup/install_unittest.cc b/chrome/installer/setup/install_unittest.cc
index ed2fd975f2..54b3629cd0 100644
--- a/chrome/installer/setup/install_unittest.cc
+++ b/chrome/installer/setup/install_unittest.cc
@@ -94,7 +94,6 @@ class InstallShortcutTest : public testing::Test {
ASSERT_TRUE(fake_user_desktop_.CreateUniqueTempDir());
ASSERT_TRUE(fake_common_desktop_.CreateUniqueTempDir());
ASSERT_TRUE(fake_user_quick_launch_.CreateUniqueTempDir());
- ASSERT_TRUE(fake_default_user_quick_launch_.CreateUniqueTempDir());
ASSERT_TRUE(fake_start_menu_.CreateUniqueTempDir());
ASSERT_TRUE(fake_common_start_menu_.CreateUniqueTempDir());
user_desktop_override_.reset(
@@ -106,9 +105,6 @@ class InstallShortcutTest : public testing::Test {
user_quick_launch_override_.reset(
new base::ScopedPathOverride(base::DIR_USER_QUICK_LAUNCH,
fake_user_quick_launch_.path()));
- default_user_quick_launch_override_.reset(
- new base::ScopedPathOverride(base::DIR_DEFAULT_USER_QUICK_LAUNCH,
- fake_default_user_quick_launch_.path()));
start_menu_override_.reset(
new base::ScopedPathOverride(base::DIR_START_MENU,
fake_start_menu_.path()));
@@ -134,8 +130,6 @@ class InstallShortcutTest : public testing::Test {
.Append(shortcut_name);
system_desktop_shortcut_ =
fake_common_desktop_.path().Append(shortcut_name);
- system_quick_launch_shortcut_ =
- fake_default_user_quick_launch_.path().Append(shortcut_name);
system_start_menu_shortcut_ =
fake_common_start_menu_.path().Append(
dist_->GetStartMenuShortcutSubfolder(
@@ -195,13 +189,11 @@ class InstallShortcutTest : public testing::Test {
base::ScopedTempDir fake_user_desktop_;
base::ScopedTempDir fake_common_desktop_;
base::ScopedTempDir fake_user_quick_launch_;
- base::ScopedTempDir fake_default_user_quick_launch_;
base::ScopedTempDir fake_start_menu_;
base::ScopedTempDir fake_common_start_menu_;
scoped_ptr<base::ScopedPathOverride> user_desktop_override_;
scoped_ptr<base::ScopedPathOverride> common_desktop_override_;
scoped_ptr<base::ScopedPathOverride> user_quick_launch_override_;
- scoped_ptr<base::ScopedPathOverride> default_user_quick_launch_override_;
scoped_ptr<base::ScopedPathOverride> start_menu_override_;
scoped_ptr<base::ScopedPathOverride> common_start_menu_override_;
@@ -209,7 +201,6 @@ class InstallShortcutTest : public testing::Test {
base::FilePath user_quick_launch_shortcut_;
base::FilePath user_start_menu_shortcut_;
base::FilePath system_desktop_shortcut_;
- base::FilePath system_quick_launch_shortcut_;
base::FilePath system_start_menu_shortcut_;
base::FilePath user_alternate_desktop_shortcut_;
};
@@ -264,16 +255,17 @@ TEST_F(InstallShortcutTest, CreateAllShortcuts) {
expected_start_menu_properties_);
}
-// Disabled failing test; http://crbug.com/329239.
-TEST_F(InstallShortcutTest, DISABLED_CreateAllShortcutsSystemLevel) {
+TEST_F(InstallShortcutTest, CreateAllShortcutsSystemLevel) {
installer::CreateOrUpdateShortcuts(
chrome_exe_, *product_, *prefs_, installer::ALL_USERS,
installer::INSTALL_SHORTCUT_CREATE_ALL);
base::win::ValidateShortcut(system_desktop_shortcut_, expected_properties_);
- base::win::ValidateShortcut(system_quick_launch_shortcut_,
- expected_properties_);
base::win::ValidateShortcut(system_start_menu_shortcut_,
expected_start_menu_properties_);
+ // The quick launch shortcut is always created per-user for the admin running
+ // the install (other users will get it via Active Setup).
+ base::win::ValidateShortcut(user_quick_launch_shortcut_,
+ expected_properties_);
}
TEST_F(InstallShortcutTest, CreateAllShortcutsAlternateDesktopName) {
@@ -376,9 +368,6 @@ TEST_F(InstallShortcutTest, CreateIfNoSystemLevelAllSystemShortcutsExist) {
ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
system_desktop_shortcut_, dummy_properties,
base::win::SHORTCUT_CREATE_ALWAYS));
- ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
- system_quick_launch_shortcut_, dummy_properties,
- base::win::SHORTCUT_CREATE_ALWAYS));
ASSERT_TRUE(base::CreateDirectory(
system_start_menu_shortcut_.DirName()));
ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
@@ -389,8 +378,10 @@ TEST_F(InstallShortcutTest, CreateIfNoSystemLevelAllSystemShortcutsExist) {
chrome_exe_, *product_, *prefs_, installer::CURRENT_USER,
installer::INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL);
ASSERT_FALSE(base::PathExists(user_desktop_shortcut_));
- ASSERT_FALSE(base::PathExists(user_quick_launch_shortcut_));
ASSERT_FALSE(base::PathExists(user_start_menu_shortcut_));
+ // There is no system-level quick launch shortcut, so creating the user-level
+ // one should always succeed.
+ ASSERT_TRUE(base::PathExists(user_quick_launch_shortcut_));
}
TEST_F(InstallShortcutTest, CreateIfNoSystemLevelNoSystemShortcutsExist) {
diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h
index ca7fd7f3d3..bc66431129 100644
--- a/chrome/installer/util/google_update_settings.h
+++ b/chrome/installer/util/google_update_settings.h
@@ -245,7 +245,7 @@ class GoogleUpdateSettings {
// Returns true if the app indicated by |app_guid| should be updated
// automatically by Google Update based on current autoupdate settings. This
- // is distinct from GetApUpdatePolicy which checks only a subset of things
+ // is distinct from GetAppUpdatePolicy which checks only a subset of things
// that can cause an app not to update.
static bool AreAutoupdatesEnabled(const base::string16& app_guid);
diff --git a/chrome/installer/util/language_selector.cc b/chrome/installer/util/language_selector.cc
index a58048d6db..c0a31bbd39 100644
--- a/chrome/installer/util/language_selector.cc
+++ b/chrome/installer/util/language_selector.cc
@@ -262,7 +262,7 @@ bool LanguageSelector::SelectIf(const std::vector<std::wstring>& candidates,
for (std::vector<std::wstring>::const_iterator scan = candidates.begin(),
end = candidates.end(); scan != end; ++scan) {
candidate.assign(*scan);
- StringToLowerASCII(&candidate);
+ base::StringToLowerASCII(&candidate);
if (select_predicate(candidate, matched_offset)) {
matched_name->assign(*scan);
return true;
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 34406a6421..2893f75197 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -1335,6 +1335,13 @@ bool BatchShortcutAction(
ShellUtil::ShellChange level,
const scoped_refptr<ShellUtil::SharedCancellationFlag>& cancel) {
DCHECK(!shortcut_operation.is_null());
+
+ // There is no system-level Quick Launch shortcut folder.
+ if (level == ShellUtil::SYSTEM_LEVEL &&
+ location == ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH) {
+ return true;
+ }
+
base::FilePath shortcut_folder;
if (!ShellUtil::GetShortcutPath(location, dist, level, &shortcut_folder)) {
LOG(WARNING) << "Cannot find path at location " << location;
@@ -1474,8 +1481,9 @@ bool ShellUtil::GetShortcutPath(ShellUtil::ShortcutLocation location,
base::DIR_COMMON_DESKTOP;
break;
case SHORTCUT_LOCATION_QUICK_LAUNCH:
- dir_key = (level == CURRENT_USER) ? base::DIR_USER_QUICK_LAUNCH :
- base::DIR_DEFAULT_USER_QUICK_LAUNCH;
+ // There is no support for a system-level Quick Launch shortcut.
+ DCHECK_EQ(level, CURRENT_USER);
+ dir_key = base::DIR_USER_QUICK_LAUNCH;
break;
case SHORTCUT_LOCATION_START_MENU_ROOT:
dir_key = (level == CURRENT_USER) ? base::DIR_START_MENU :
@@ -1539,7 +1547,11 @@ bool ShellUtil::CreateOrUpdateShortcut(
base::FilePath user_shortcut_path;
base::FilePath system_shortcut_path;
- if (!GetShortcutPath(location, dist, SYSTEM_LEVEL, &system_shortcut_path)) {
+ if (location == SHORTCUT_LOCATION_QUICK_LAUNCH) {
+ // There is no system-level shortcut for Quick Launch.
+ DCHECK_EQ(properties.level, CURRENT_USER);
+ } else if (!GetShortcutPath(
+ location, dist, SYSTEM_LEVEL, &system_shortcut_path)) {
NOTREACHED();
return false;
}
@@ -1554,6 +1566,7 @@ bool ShellUtil::CreateOrUpdateShortcut(
// Install the system-level shortcut if requested.
chosen_path = &system_shortcut_path;
} else if (operation != SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL ||
+ system_shortcut_path.empty() ||
!base::PathExists(system_shortcut_path)) {
// Otherwise install the user-level shortcut, unless the system-level
// variant of this shortcut is present on the machine and |operation| states
diff --git a/chrome/installer/util/shell_util_unittest.cc b/chrome/installer/util/shell_util_unittest.cc
index 134b31cf06..9cca44a4e4 100644
--- a/chrome/installer/util/shell_util_unittest.cc
+++ b/chrome/installer/util/shell_util_unittest.cc
@@ -71,9 +71,6 @@ class ShellUtilShortcutTest : public testing::Test {
user_quick_launch_override_.reset(
new base::ScopedPathOverride(base::DIR_USER_QUICK_LAUNCH,
fake_user_quick_launch_.path()));
- default_user_quick_launch_override_.reset(
- new base::ScopedPathOverride(base::DIR_DEFAULT_USER_QUICK_LAUNCH,
- fake_default_user_quick_launch_.path()));
start_menu_override_.reset(
new base::ScopedPathOverride(base::DIR_START_MENU,
fake_start_menu_.path()));
@@ -104,9 +101,7 @@ class ShellUtilShortcutTest : public testing::Test {
fake_user_desktop_.path() : fake_common_desktop_.path();
break;
case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH:
- expected_path = (properties.level == ShellUtil::CURRENT_USER) ?
- fake_user_quick_launch_.path() :
- fake_default_user_quick_launch_.path();
+ expected_path = fake_user_quick_launch_.path();
break;
case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR:
expected_path = (properties.level == ShellUtil::CURRENT_USER) ?
@@ -195,7 +190,6 @@ class ShellUtilShortcutTest : public testing::Test {
scoped_ptr<base::ScopedPathOverride> user_desktop_override_;
scoped_ptr<base::ScopedPathOverride> common_desktop_override_;
scoped_ptr<base::ScopedPathOverride> user_quick_launch_override_;
- scoped_ptr<base::ScopedPathOverride> default_user_quick_launch_override_;
scoped_ptr<base::ScopedPathOverride> start_menu_override_;
scoped_ptr<base::ScopedPathOverride> common_start_menu_override_;
@@ -209,18 +203,19 @@ class ShellUtilShortcutTest : public testing::Test {
TEST_F(ShellUtilShortcutTest, GetShortcutPath) {
base::FilePath path;
+
ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
ShellUtil::CURRENT_USER, &path);
EXPECT_EQ(fake_user_desktop_.path(), path);
+
ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
ShellUtil::SYSTEM_LEVEL, &path);
EXPECT_EQ(fake_common_desktop_.path(), path);
+
ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_,
ShellUtil::CURRENT_USER, &path);
EXPECT_EQ(fake_user_quick_launch_.path(), path);
- ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_,
- ShellUtil::SYSTEM_LEVEL, &path);
- EXPECT_EQ(fake_default_user_quick_launch_.path(), path);
+
base::string16 start_menu_subfolder =
dist_->GetStartMenuShortcutSubfolder(
BrowserDistribution::SUBFOLDER_CHROME);
@@ -228,6 +223,7 @@ TEST_F(ShellUtilShortcutTest, GetShortcutPath) {
dist_, ShellUtil::CURRENT_USER, &path);
EXPECT_EQ(fake_start_menu_.path().Append(start_menu_subfolder),
path);
+
ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR,
dist_, ShellUtil::SYSTEM_LEVEL, &path);
EXPECT_EQ(fake_common_start_menu_.path().Append(start_menu_subfolder),
@@ -255,10 +251,10 @@ TEST_F(ShellUtilShortcutTest, CreateStartMenuShortcutWithAllProperties) {
dist_, test_properties_);
}
-TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelQuickLaunchShortcut) {
+TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelDesktopShortcut) {
test_properties_.level = ShellUtil::SYSTEM_LEVEL;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP,
dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
@@ -267,7 +263,7 @@ TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelQuickLaunchShortcut) {
new_properties.set_description(L"New description");
new_properties.set_arguments(L"--new-arguments");
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP,
dist_, new_properties,
ShellUtil::SHELL_SHORTCUT_REPLACE_EXISTING));
@@ -277,7 +273,7 @@ TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelQuickLaunchShortcut) {
ShellUtil::ShortcutProperties expected_properties(new_properties);
expected_properties.set_dual_mode(false);
- ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_,
+ ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
expected_properties);
}