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

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

Issue 295943002: Multi-Profile in Files.app: always mount per-profile "Downloads" folder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revived the "first profile" check more sanely. Created 6 years, 7 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 | chrome/browser/chromeos/file_manager/volume_manager.cc » ('j') | 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 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);
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/volume_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698