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

Unified Diff: chrome/common/chrome_paths_linux.cc

Issue 10255018: Linux: Use the same safe downloads logic as Windows. (try 2) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix build for vs2010 Created 8 years, 8 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_internal.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_paths_linux.cc
===================================================================
--- chrome/common/chrome_paths_linux.cc (revision 134373)
+++ chrome/common/chrome_paths_linux.cc (working copy)
@@ -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 @@
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;
}
« no previous file with comments | « chrome/common/chrome_paths_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698