summaryrefslogtreecommitdiffstats
path: root/chrome/common/chrome_paths_linux.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 21:48:27 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 21:48:27 +0000
commit3499ed701e63654e1129036073e81a50f141ed8a (patch)
treef5492c066e876e2ba8bb6313014259ae784d8c24 /chrome/common/chrome_paths_linux.cc
parent669aff217eaa6c54f8a928078c54dd937e8080a0 (diff)
downloadchromium_src-3499ed701e63654e1129036073e81a50f141ed8a.zip
chromium_src-3499ed701e63654e1129036073e81a50f141ed8a.tar.gz
chromium_src-3499ed701e63654e1129036073e81a50f141ed8a.tar.bz2
Linux: Use the same safe downloads logic as Windows.
BUG=none TEST=none Review URL: http://codereview.chromium.org/10241007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_paths_linux.cc')
-rw-r--r--chrome/common/chrome_paths_linux.cc23
1 files changed, 7 insertions, 16 deletions
diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc
index f5d4549..acfebc1 100644
--- a/chrome/common/chrome_paths_linux.cc
+++ b/chrome/common/chrome_paths_linux.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -84,25 +84,16 @@ bool GetUserDocumentsDirectory(FilePath* result) {
return true;
}
-// We respect the user's preferred download location, unless it is
-// ~ or their desktop directory, in which case we default to ~/Downloads.
+bool GetUserDownloadsDirectorySafe(FilePath* result) {
+ FilePath home = file_util::GetHomeDir();
+ *result = home.Append(kDownloadsDir);
+ return true;
+}
+
bool GetUserDownloadsDirectory(FilePath* result) {
scoped_ptr<base::Environment> env(base::Environment::Create());
*result = base::nix::GetXDGUserDirectory(env.get(), "DOWNLOAD",
kDownloadsDir);
-
- FilePath home = file_util::GetHomeDir();
- if (*result == home) {
- *result = home.Append(kDownloadsDir);
- return true;
- }
-
- FilePath desktop;
- GetUserDesktop(&desktop);
- if (*result == desktop) {
- *result = home.Append(kDownloadsDir);
- }
-
return true;
}