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

Unified Diff: chrome/browser/chromeos/file_manager/path_util.cc

Issue 48903012: Switch "Downloads" directory path to the per-profile ones for multi-profile support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_manager/path_util.cc
diff --git a/chrome/browser/chromeos/file_manager/path_util.cc b/chrome/browser/chromeos/file_manager/path_util.cc
index 2ca8d44ccbdacabc73b3bae9c3f55cf6e768397f..d8a9c2818cbdd1ab6ee68f901362f0b3f17f9d9f 100644
--- a/chrome/browser/chromeos/file_manager/path_util.cc
+++ b/chrome/browser/chromeos/file_manager/path_util.cc
@@ -7,7 +7,9 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"
+#include "base/sys_info.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
+#include "chrome/browser/profiles/profile.h"
namespace file_manager {
namespace util {
@@ -17,14 +19,15 @@ const base::FilePath::CharType kOldDownloadsFolderPath[] =
FILE_PATH_LITERAL("/home/chronos/user/Downloads");
base::FilePath GetDownloadsFolderForProfile(Profile* profile) {
- // TODO(kinaba) crbug/309556: "Downloads" directory should be per-profile.
- //
- // For this to be per-profile, a unique directory path from profile->GetPath()
- // should be used rather than the HOME directory. We'll switch to the new path
- // once we have upgraded all code locations assuming the old path.
- base::FilePath path;
- CHECK(PathService::Get(base::DIR_HOME, &path));
- return path.AppendASCII(kDownloadsFolderName);
+ if (!base::SysInfo::IsRunningOnChromeOS()) {
+ // On the developer run on Linux desktop build, user $HOME/Downloads
+ // for ease for accessing local files for debugging.
+ base::FilePath path;
+ CHECK(PathService::Get(base::DIR_HOME, &path));
+ return path.AppendASCII(kDownloadsFolderName);
+ }
+
+ return profile->GetPath().AppendASCII(kDownloadsFolderName);
}
bool MigratePathFromOldFormat(Profile* profile,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698