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

Unified Diff: base/base_paths_win.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: base/base_paths_win.cc
diff --git a/base/base_paths_win.cc b/base/base_paths_win.cc
index 509d5fd7ef1731a54a22f997d0bce489dc3ebfaa..509bcb40eb8a6539bee245d81c01f3a09ad5c2b1 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,20 @@ 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))
+ if (!PathService::Get(base::DIR_APP_DATA, &cur)) {
+ // For the current user, grab the APPDATA directory directly from the
grt (UTC plus 2) 2014/08/04 18:27:07 nit: move this comment up above the "if" and nix t
gab 2014/08/04 18:57:07 Actually I'll just remove this comment, it's no lo
+ // 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
+ cur = cur.AppendASCII("Microsoft")
+ .AppendASCII("Internet Explorer")
grt (UTC plus 2) 2014/08/04 18:27:08 is this how git cl format does things? shouldn't t
gab 2014/08/04 18:57:08 Yes it is, I like it as-is personally.
+ .AppendASCII("Quick Launch");
break;
case base::DIR_TASKBAR_PINS:
if (!PathService::Get(base::DIR_USER_QUICK_LAUNCH, &cur))

Powered by Google App Engine
This is Rietveld 408576698