diff options
| author | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-16 00:20:32 +0000 |
|---|---|---|
| committer | nkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-16 00:20:32 +0000 |
| commit | 96a8fa1b58b726ad19c7b86c28b2770d69fa73f6 (patch) | |
| tree | 0144e9f5270f027372348b801a5975ef1492c756 /chrome/common | |
| parent | 8afc64910396ff88dcafd306b0a7aeb96000bf63 (diff) | |
| download | chromium_src-96a8fa1b58b726ad19c7b86c28b2770d69fa73f6.zip chromium_src-96a8fa1b58b726ad19c7b86c28b2770d69fa73f6.tar.gz chromium_src-96a8fa1b58b726ad19c7b86c28b2770d69fa73f6.tar.bz2 | |
Move all callers of GetHomeDir() to PathService::Get(base::DIR_HOME).
* Fixes GetHomeDir() for multi-profiles case on Chrome OS.
* Once user signs in on Chrome OS base::DIR_HOME is overridden with primary user homedir.
* Added content switch --homedir to pass that information to ppapi plugins since they run in a separate process and previous base::DIR_HOME override does not apply there.
This fix doesn't require checking for --multi-profiles switch
since user_id hash is known even without it.
BUG=331530
TBR=vitalybuka@chromium.org
Review URL: https://codereview.chromium.org/200473002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
| -rw-r--r-- | chrome/common/chrome_paths_linux.cc | 8 | ||||
| -rw-r--r-- | chrome/common/chrome_paths_unittest.cc | 4 | ||||
| -rw-r--r-- | chrome/common/importer/firefox_importer_utils_linux.cc | 6 |
3 files changed, 14 insertions, 4 deletions
diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc index eeb1b9a..95dd086 100644 --- a/chrome/common/chrome_paths_linux.cc +++ b/chrome/common/chrome_paths_linux.cc @@ -4,11 +4,13 @@ #include "chrome/common/chrome_paths_internal.h" +#include "base/base_paths.h" #include "base/environment.h" #include "base/file_util.h" #include "base/memory/scoped_ptr.h" #include "base/nix/xdg_util.h" #include "base/path_service.h" +#include "chrome/common/chrome_paths.h" namespace chrome { @@ -34,7 +36,8 @@ bool GetUserMediaDirectory(const std::string& xdg_name, #else *result = GetXDGUserDirectory(xdg_name.c_str(), fallback_name.c_str()); - base::FilePath home = base::GetHomeDir(); + base::FilePath home; + PathService::Get(base::DIR_HOME, &home); if (*result != home) { base::FilePath desktop; if (!PathService::Get(base::DIR_USER_DESKTOP, &desktop)) @@ -103,7 +106,8 @@ bool GetUserDocumentsDirectory(base::FilePath* result) { } bool GetUserDownloadsDirectorySafe(base::FilePath* result) { - base::FilePath home = base::GetHomeDir(); + base::FilePath home; + PathService::Get(base::DIR_HOME, &home); *result = home.Append(kDownloadsDir); return true; } diff --git a/chrome/common/chrome_paths_unittest.cc b/chrome/common/chrome_paths_unittest.cc index 5251154..3816cf6 100644 --- a/chrome/common/chrome_paths_unittest.cc +++ b/chrome/common/chrome_paths_unittest.cc @@ -6,6 +6,7 @@ #include <stdlib.h> +#include "base/base_paths.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/path_service.h" @@ -29,7 +30,8 @@ TEST(ChromePaths, UserCacheDir) { base::FilePath expected_cache_dir; ASSERT_TRUE(PathService::Get(base::DIR_CACHE, &expected_cache_dir)); #elif(OS_POSIX) - base::FilePath homedir = base::GetHomeDir(); + base::FilePath homedir; + PathService::Get(base::DIR_HOME, &homedir); // Note: we assume XDG_CACHE_HOME/XDG_CONFIG_HOME are at their // default settings. test_profile_dir = homedir.Append(".config/foobar"); diff --git a/chrome/common/importer/firefox_importer_utils_linux.cc b/chrome/common/importer/firefox_importer_utils_linux.cc index 71f1a26..081a294 100644 --- a/chrome/common/importer/firefox_importer_utils_linux.cc +++ b/chrome/common/importer/firefox_importer_utils_linux.cc @@ -4,13 +4,17 @@ #include "chrome/common/importer/firefox_importer_utils.h" +#include "base/base_paths.h" #include "base/file_util.h" +#include "base/files/file_path.h" +#include "base/path_service.h" base::FilePath GetProfilesINI() { base::FilePath ini_file; // The default location of the profile folder containing user data is // under user HOME directory in .mozilla/firefox folder on Linux. - base::FilePath home = base::GetHomeDir(); + base::FilePath home; + PathService::Get(base::DIR_HOME, &home); if (!home.empty()) { ini_file = home.Append(".mozilla/firefox/profiles.ini"); } |
