diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 00:13:40 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 00:13:40 +0000 |
commit | e5738a07937558b0e79d047ac69dc119ac4920aa (patch) | |
tree | ed627cbcd774fd30b0ead5db2a6315ff8fba1f87 /chrome/common/chrome_paths_linux.cc | |
parent | 53895a82f11820984f1f872fa32231c9e61ee8fe (diff) | |
download | chromium_src-e5738a07937558b0e79d047ac69dc119ac4920aa.zip chromium_src-e5738a07937558b0e79d047ac69dc119ac4920aa.tar.gz chromium_src-e5738a07937558b0e79d047ac69dc119ac4920aa.tar.bz2 |
Add new PathService paths for Windows' All Users Desktop and Quick Launch folders.
This allows usage of PathService to cache the paths and more importantly to mock them in shortcut tests!
Also move chrome::DIR_USER_DESKTOP to base::DIR_USER_DESKTOP; this is really where it belongs. In fact it is only in chrome_paths.h because it used to be called DIR_DEFAULT_DOWNLOAD and cpu@ renamed it to DIR_USER_DESKTOP in http://crrev.com/1753 (early days!) after that it started to be used all over the place as the Desktop path. Finally bringing it to base_paths.h, beside DIR_START_MENU and friends, is the right thing to do imo.
BUG=148539
TEST=Quick Launch shortcut installed in the right place on XP (both Default and current user)
Desktop shortcuts installed in the right place (both All Users and per-user installs).
installer_util_unittests.exe --gtest_filter=ShellUtilShortcutTest*
unit_tests.exe --gtest_filter=ProfileShortcutManagerTest*
base_unittests --gtest_filter=PathServiceTest*
Review URL: https://chromiumcodereview.appspot.com/10910209
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157667 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_paths_linux.cc')
-rw-r--r-- | chrome/common/chrome_paths_linux.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc index 321032f..babb501 100644 --- a/chrome/common/chrome_paths_linux.cc +++ b/chrome/common/chrome_paths_linux.cc @@ -37,7 +37,8 @@ bool GetUserMediaDirectory(const std::string& xdg_name, FilePath home = file_util::GetHomeDir(); if (*result != home) { FilePath desktop; - GetUserDesktop(&desktop); + if (!PathService::Get(base::DIR_USER_DESKTOP, &desktop)) + return false; if (*result != desktop) { return true; } @@ -142,11 +143,6 @@ bool GetUserVideosDirectory(FilePath* result) { return GetUserMediaDirectory("VIDEOS", kVideosDir, result); } -bool GetUserDesktop(FilePath* result) { - *result = GetXDGUserDirectory("DESKTOP", "Desktop"); - return true; -} - bool ProcessNeedsProfileDir(const std::string& process_type) { // For now we have no reason to forbid this on Linux as we don't // have the roaming profile troubles there. Moreover the Linux breakpad needs |