summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-08 18:17:53 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-08 18:19:12 +0000
commitda4d4fb02cb4849277880d95db38361de09b3885 (patch)
tree9e3e438569c43c861dd69073b03ce3df45885ca9 /base
parent33d76bb0f87cd9e3ad5b1589bb29872924e4e5e3 (diff)
downloadchromium_src-da4d4fb02cb4849277880d95db38361de09b3885.zip
chromium_src-da4d4fb02cb4849277880d95db38361de09b3885.tar.gz
chromium_src-da4d4fb02cb4849277880d95db38361de09b3885.tar.bz2
Fix shortcut tests and remove legacy shortcut code for the Default-user
Quick Launch shortcut. InstallShortcutTest.CreateAllShortcutsSystemLevel has been broken since http://crrev.com/164849 ... The test expectations had not been adjusted in this CL as setup_unittests.exe doesn't run on the waterfall yet (issue #153829) and the breakage had gone unnoticed. Expectations have now been adjusted such that we no longer expect a system-level (Default-user) Quick Launch shortcut, but a per-user Quick Launch shortcut for the admin running the install as the product code's logic has been doing for over a year... Also remove the code cleaning up the legacy Default-user Quick Launch shortcut as this cleanup code has been running for 21 months now and leaving this shortcut behind for a few users is a no-op (i.e. the Default-user shortcut will get copied to new Windows profiles and Active Setup will kick in a few seconds later to try to install the same shortcut which will already exist... the UX result will be the same: a single Chrome Quick Launch shortcut will be installed). BUG=329239, 153829 Review URL: https://codereview.chromium.org/432273005 Cr-Commit-Position: refs/heads/master@{#288393} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288393 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/base_paths_win.cc49
-rw-r--r--base/base_paths_win.h2
-rw-r--r--base/path_service_unittest.cc16
3 files changed, 12 insertions, 55 deletions
diff --git a/base/base_paths_win.cc b/base/base_paths_win.cc
index 509d5fd..a9b31c7b 100644
--- a/base/base_paths_win.cc
+++ b/base/base_paths_win.cc
@@ -16,38 +16,6 @@ extern "C" IMAGE_DOS_HEADER __ImageBase;
using base::FilePath;
-namespace {
-
-bool GetQuickLaunchPath(bool default_user, FilePath* result) {
- if (default_user) {
- wchar_t system_buffer[MAX_PATH];
- system_buffer[0] = 0;
- // As per MSDN, passing -1 for |hToken| indicates the Default user:
- // http://msdn.microsoft.com/library/windows/desktop/bb762181.aspx
- if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA,
- reinterpret_cast<HANDLE>(-1), SHGFP_TYPE_CURRENT,
- system_buffer))) {
- return false;
- }
- *result = FilePath(system_buffer);
- } else if (!PathService::Get(base::DIR_APP_DATA, result)) {
- // For the current user, grab the APPDATA directory directly from the
- // PathService cache.
- return false;
- }
- // According to various sources, appending
- // "Microsoft\Internet Explorer\Quick Launch" to %appdata% is the only
- // reliable way to get the quick launch folder across all versions of Windows.
- // http://stackoverflow.com/questions/76080/how-do-you-reliably-get-the-quick-
- // http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/hey0901.mspx
- *result = result->AppendASCII("Microsoft");
- *result = result->AppendASCII("Internet Explorer");
- *result = result->AppendASCII("Quick Launch");
- return true;
-}
-
-} // namespace
-
namespace base {
bool PathProviderWin(int key, FilePath* result) {
@@ -178,12 +146,17 @@ bool PathProviderWin(int key, FilePath* result) {
cur = FilePath(system_buffer);
break;
case base::DIR_USER_QUICK_LAUNCH:
- if (!GetQuickLaunchPath(false, &cur))
- return false;
- break;
- case base::DIR_DEFAULT_USER_QUICK_LAUNCH:
- if (!GetQuickLaunchPath(true, &cur))
- return false;
+ if (!PathService::Get(base::DIR_APP_DATA, &cur))
+ return false;
+ // According to various sources, appending
+ // "Microsoft\Internet Explorer\Quick Launch" to %appdata% is the only
+ // reliable way to get the quick launch folder across all versions of
+ // Windows.
+ // http://stackoverflow.com/questions/76080/how-do-you-reliably-get-the-quick-
+ // http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/hey0901.mspx
+ cur = cur.AppendASCII("Microsoft")
+ .AppendASCII("Internet Explorer")
+ .AppendASCII("Quick Launch");
break;
case base::DIR_TASKBAR_PINS:
if (!PathService::Get(base::DIR_USER_QUICK_LAUNCH, &cur))
diff --git a/base/base_paths_win.h b/base/base_paths_win.h
index b042d08..4620171 100644
--- a/base/base_paths_win.h
+++ b/base/base_paths_win.h
@@ -37,8 +37,6 @@ enum {
DIR_COMMON_DESKTOP, // Directory for the common desktop (visible
// on all user's Desktop).
DIR_USER_QUICK_LAUNCH, // Directory for the quick launch shortcuts.
- DIR_DEFAULT_USER_QUICK_LAUNCH, // Directory for the quick launch shortcuts
- // of the Default user.
DIR_TASKBAR_PINS, // Directory for the shortcuts pinned to taskbar via
// base::win::TaskbarPinShortcutLink().
DIR_WINDOWS_FONTS, // Usually C:\Windows\Fonts.
diff --git a/base/path_service_unittest.cc b/base/path_service_unittest.cc
index 7a70a89..a345262 100644
--- a/base/path_service_unittest.cc
+++ b/base/path_service_unittest.cc
@@ -15,10 +15,7 @@
#include "testing/platform_test.h"
#if defined(OS_WIN)
-#include <userenv.h>
#include "base/win/windows_version.h"
-// userenv.dll is required for GetDefaultUserProfileDirectory().
-#pragma comment(lib, "userenv.lib")
#endif
namespace {
@@ -45,18 +42,7 @@ bool ReturnsValidPath(int dir_type) {
check_path_exists = false;
#endif
#if defined(OS_WIN)
- if (dir_type == base::DIR_DEFAULT_USER_QUICK_LAUNCH) {
- // On Windows XP, the Quick Launch folder for the "Default User" doesn't
- // exist by default. At least confirm that the path returned begins with the
- // Default User's profile path.
- if (base::win::GetVersion() < base::win::VERSION_VISTA) {
- wchar_t default_profile_path[MAX_PATH];
- DWORD size = arraysize(default_profile_path);
- return (result &&
- ::GetDefaultUserProfileDirectory(default_profile_path, &size) &&
- StartsWith(path.value(), default_profile_path, false));
- }
- } else if (dir_type == base::DIR_TASKBAR_PINS) {
+ if (dir_type == base::DIR_TASKBAR_PINS) {
// There is no pinned-to-taskbar shortcuts prior to Win7.
if (base::win::GetVersion() < base::win::VERSION_WIN7)
check_path_exists = false;