From 6bdc52278501985dd265048a5d14a2ba282d0717 Mon Sep 17 00:00:00 2001 From: "nkostylev@chromium.org" Date: Tue, 27 May 2014 00:12:33 +0000 Subject: 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. Note: download_prefs.cc still uses GetHomeDir() in its DownloadPathIsDangerous() check. // Consider downloads 'dangerous' if they go to the home directory on Linux and // to the desktop on any platform. In this context correct behavior is to use "real" base::GetHomeDir() and not "virtual one" base::DIR_HOME. Since latter is remapped to some test dir in tests, in some subfolders in Chrome OS etc. BUG=331530 TBR=vitalybuka@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=270872 Review URL: https://codereview.chromium.org/200473002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272898 0039d316-1c4b-4281-b951-d872f2087c98 --- rlz/chromeos/lib/rlz_value_store_chromeos.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'rlz') diff --git a/rlz/chromeos/lib/rlz_value_store_chromeos.cc b/rlz/chromeos/lib/rlz_value_store_chromeos.cc index 0cd87af..c54a194 100644 --- a/rlz/chromeos/lib/rlz_value_store_chromeos.cc +++ b/rlz/chromeos/lib/rlz_value_store_chromeos.cc @@ -4,11 +4,13 @@ #include "rlz/chromeos/lib/rlz_value_store_chromeos.h" +#include "base/base_paths.h" #include "base/file_util.h" #include "base/files/important_file_writer.h" #include "base/json/json_file_value_serializer.h" #include "base/json/json_string_value_serializer.h" #include "base/logging.h" +#include "base/path_service.h" #include "base/sequenced_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" @@ -42,15 +44,19 @@ base::FilePath g_testing_rlz_store_path_; // Returns file path of the RLZ storage. base::FilePath GetRlzStorePath() { + base::FilePath homedir; + PathService::Get(base::DIR_HOME, &homedir); return g_testing_rlz_store_path_.empty() ? - base::GetHomeDir().Append(kRLZDataFileName) : + homedir.Append(kRLZDataFileName) : g_testing_rlz_store_path_.Append(kRLZDataFileName); } // Returns file path of the RLZ storage lock file. base::FilePath GetRlzStoreLockPath() { + base::FilePath homedir; + PathService::Get(base::DIR_HOME, &homedir); return g_testing_rlz_store_path_.empty() ? - base::GetHomeDir().Append(kRLZLockFileName) : + homedir.Append(kRLZLockFileName) : g_testing_rlz_store_path_.Append(kRLZLockFileName); } -- cgit v1.1