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

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

Issue 10964007: Re-commit: Add new PathService paths for Windows' All Users Desktop and Quick Launch folders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows only includes/pragma in the ifdef OS_WIN Created 8 years, 3 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
« no previous file with comments | « chrome/common/chrome_paths_win.cc ('k') | chrome/installer/util/shell_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index f6e696c1f885aaaf39f0f2236de47cb32ebbbaff..3e2d19a38bc50a70806b6c3894cb0bb687b54cce 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -1098,43 +1098,15 @@ bool ShellUtil::GetChromeShortcutName(BrowserDistribution* dist,
}
bool ShellUtil::GetDesktopPath(bool system_level, FilePath* path) {
- wchar_t desktop[MAX_PATH];
- int dir = system_level ? CSIDL_COMMON_DESKTOPDIRECTORY :
- CSIDL_DESKTOPDIRECTORY;
- if (FAILED(SHGetFolderPath(NULL, dir, NULL, SHGFP_TYPE_CURRENT, desktop)))
- return false;
- *path = FilePath(desktop);
- return true;
+ int dir_key = system_level ? base::DIR_COMMON_DESKTOP :
+ base::DIR_USER_DESKTOP;
+ return PathService::Get(dir_key, path);
}
bool ShellUtil::GetQuickLaunchPath(bool system_level, FilePath* path) {
- if (system_level) {
- wchar_t qlaunch[MAX_PATH];
- // We are accessing GetDefaultUserProfileDirectory this way so that we do
- // not have to declare dependency to Userenv.lib for chrome.exe
- typedef BOOL (WINAPI *PROFILE_FUNC)(LPWSTR, LPDWORD);
- HMODULE module = LoadLibrary(L"Userenv.dll");
- PROFILE_FUNC p = reinterpret_cast<PROFILE_FUNC>(GetProcAddress(module,
- "GetDefaultUserProfileDirectoryW"));
- DWORD size = _countof(qlaunch);
- if ((p == NULL) || ((p)(qlaunch, &size) != TRUE))
- return false;
- *path = FilePath(qlaunch);
- if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
- *path = path->AppendASCII("AppData");
- *path = path->AppendASCII("Roaming");
- } else {
- *path = path->AppendASCII("Application Data");
- }
- } else {
- if (!PathService::Get(base::DIR_APP_DATA, path)) {
- return false;
- }
- }
- *path = path->AppendASCII("Microsoft");
- *path = path->AppendASCII("Internet Explorer");
- *path = path->AppendASCII("Quick Launch");
- return true;
+ int dir_key = system_level ? base::DIR_DEFAULT_USER_QUICK_LAUNCH :
+ base::DIR_USER_QUICK_LAUNCH;
+ return PathService::Get(dir_key, path);
}
void ShellUtil::GetRegisteredBrowsers(
« no previous file with comments | « chrome/common/chrome_paths_win.cc ('k') | chrome/installer/util/shell_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698