PathService -> base::PathService

This commit is contained in:
Jeremy Apthorp
2018-09-14 17:09:42 -07:00
committed by Aleksei Kuzmin
parent 7092fa31a4
commit de581ca0b4
17 changed files with 30 additions and 28 deletions

View File

@@ -115,7 +115,7 @@ NetLog* BrowserClient::GetNetLog() {
base::FilePath BrowserClient::GetDefaultDownloadDirectory() {
// ~/Downloads
base::FilePath path;
if (PathService::Get(base::DIR_HOME, &path))
if (base::PathService::Get(base::DIR_HOME, &path))
path = path.Append(FILE_PATH_LITERAL("Downloads"));
return path;

View File

@@ -57,10 +57,10 @@ scoped_refptr<BrowserContext> BrowserContext::Get(const std::string& partition,
BrowserContext::BrowserContext(const std::string& partition, bool in_memory)
: in_memory_(in_memory), weak_factory_(this) {
if (!PathService::Get(DIR_USER_DATA, &path_)) {
PathService::Get(DIR_APP_DATA, &path_);
if (!base::PathService::Get(DIR_USER_DATA, &path_)) {
base::PathService::Get(DIR_APP_DATA, &path_);
path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
PathService::Override(DIR_USER_DATA, path_);
base::PathService::Override(DIR_USER_DATA, path_);
}
if (!in_memory_ && !partition.empty())

View File

@@ -95,12 +95,12 @@ const int kWaitForUIThreadSeconds = 10;
void OverrideLinuxAppDataPath() {
base::FilePath path;
if (PathService::Get(DIR_APP_DATA, &path))
if (base::PathService::Get(DIR_APP_DATA, &path))
return;
std::unique_ptr<base::Environment> env(base::Environment::Create());
path = base::nix::GetXDGDirectory(env.get(), base::nix::kXdgConfigHomeEnvVar,
base::nix::kDotConfigDir);
PathService::Override(DIR_APP_DATA, path);
base::PathService::Override(DIR_APP_DATA, path);
}
int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) {
@@ -173,10 +173,10 @@ BrowserMainParts::~BrowserMainParts() {}
#if defined(OS_WIN) || defined(OS_LINUX)
void OverrideAppLogsPath() {
base::FilePath path;
if (PathService::Get(brightray::DIR_APP_DATA, &path)) {
if (base::PathService::Get(brightray::DIR_APP_DATA, &path)) {
path = path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
path = path.Append(base::FilePath::FromUTF8Unsafe("logs"));
PathService::Override(DIR_APP_LOGS, path);
base::PathService::Override(DIR_APP_LOGS, path);
}
}
#endif

View File

@@ -15,7 +15,8 @@ void BrowserMainParts::OverrideAppLogsPath() {
NSString* libraryPath =
[NSHomeDirectory() stringByAppendingPathComponent:logsPath];
PathService::Override(DIR_APP_LOGS, base::FilePath([libraryPath UTF8String]));
base::PathService::Override(DIR_APP_LOGS,
base::FilePath([libraryPath UTF8String]));
}
// Replicates NSApplicationMain, but doesn't start a run loop.