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

Unified Diff: chrome/installer/util/shell_util.cc

Issue 432273005: Fix shortcut tests and remove legacy shortcut code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 34406a6421519b461952527a2b8f768fc16721a6..f1b2d8c6d82ae2952635c79d6732bc7bf9d7b5f1 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -1474,8 +1474,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 +1540,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 +1559,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

Powered by Google App Engine
This is Rietveld 408576698