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 /base/nix | |
| 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 'base/nix')
| -rw-r--r-- | base/nix/xdg_util.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/base/nix/xdg_util.cc b/base/nix/xdg_util.cc index 4c1510f..4086a3d 100644 --- a/base/nix/xdg_util.cc +++ b/base/nix/xdg_util.cc @@ -6,9 +6,11 @@ #include <string> +#include "base/base_paths.h" #include "base/environment.h" #include "base/file_util.h" #include "base/files/file_path.h" +#include "base/path_service.h" #include "base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h" namespace { @@ -28,10 +30,12 @@ FilePath GetXDGDirectory(Environment* env, const char* env_name, const char* fallback_dir) { FilePath path; std::string env_value; - if (env->GetVar(env_name, &env_value) && !env_value.empty()) + if (env->GetVar(env_name, &env_value) && !env_value.empty()) { path = FilePath(env_value); - else - path = GetHomeDir().Append(fallback_dir); + } else { + PathService::Get(base::DIR_HOME, &path); + path = path.Append(fallback_dir); + } return path.StripTrailingSeparators(); } @@ -42,7 +46,8 @@ FilePath GetXDGUserDirectory(const char* dir_name, const char* fallback_dir) { path = FilePath(xdg_dir); free(xdg_dir); } else { - path = GetHomeDir().Append(fallback_dir); + PathService::Get(base::DIR_HOME, &path); + path = path.Append(fallback_dir); } return path.StripTrailingSeparators(); } |
