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 ff31776909e88458459b6a16cda1a358031992da..f93f97921a6e8841e8a9c25145429e5404a2bb9c 100644 |
--- a/chrome/browser/chromeos/file_manager/path_util.cc |
+++ b/chrome/browser/chromeos/file_manager/path_util.cc |
@@ -6,7 +6,6 @@ |
#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/chromeos/login/users/user.h" |
@@ -33,12 +32,17 @@ const base::FilePath::CharType kBuggyDriveFolderPath[] = |
} // namespace |
base::FilePath GetDownloadsFolderForProfile(Profile* profile) { |
- if (!base::SysInfo::IsRunningOnChromeOS()) { |
- // On the developer run on Linux desktop build, use $HOME/Downloads for ease |
- // for accessing local files for debugging. |
- base::FilePath path; |
- CHECK(PathService::Get(base::DIR_HOME, &path)); |
- return path.AppendASCII(kDownloadsFolderName); |
+ // On non-ChromeOS system (test+development), the primary profile uses |
+ // $HOME/Downloads for ease for accessing local files for debugging. |
+ if (!base::SysInfo::IsRunningOnChromeOS() && |
+ chromeos::UserManager::IsInitialized()) { |
+ const chromeos::User* const user = |
+ chromeos::UserManager::Get()->GetUserByProfile( |
+ profile->GetOriginalProfile()); |
+ const chromeos::User* const primary_user = |
+ chromeos::UserManager::Get()->GetPrimaryUser(); |
+ if (user == primary_user) |
+ return DownloadPrefs::GetDefaultDownloadDirectory(); |
} |
return profile->GetPath().AppendASCII(kDownloadsFolderName); |
} |