mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
PathService -> base::PathService
This commit is contained in:
committed by
Aleksei Kuzmin
parent
7092fa31a4
commit
de581ca0b4
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user