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

@ -837,7 +837,7 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
base::FilePath path;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::Get(key, &path);
succeed = base::PathService::Get(key, &path);
if (!succeed)
args->ThrowError("Failed to get '" + name + "' path");
return path;
@ -854,7 +854,8 @@ void App::SetPath(mate::Arguments* args,
bool succeed = false;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::OverrideAndCreateIfNeeded(key, path, true, false);
succeed =
base::PathService::OverrideAndCreateIfNeeded(key, path, true, false);
if (!succeed)
args->ThrowError("Failed to set path");
}
@ -886,7 +887,7 @@ bool App::RequestSingleInstanceLock() {
return true;
base::FilePath user_dir;
PathService::Get(brightray::DIR_USER_DATA, &user_dir);
base::PathService::Get(brightray::DIR_USER_DATA, &user_dir);
auto cb = base::Bind(&App::OnSecondInstance, base::Unretained(this));
@ -935,7 +936,7 @@ bool App::Relaunch(mate::Arguments* js_args) {
if (exec_path.empty()) {
base::FilePath current_exe_path;
PathService::Get(base::FILE_EXE, &current_exe_path);
base::PathService::Get(base::FILE_EXE, &current_exe_path);
argv.push_back(current_exe_path.value());
} else {
argv.push_back(exec_path.value());

View file

@ -312,7 +312,7 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
// Make sure we're about to launch a known executable
{
base::FilePath child_path;
PathService::Get(content::CHILD_PROCESS_EXE, &child_path);
base::PathService::Get(content::CHILD_PROCESS_EXE, &child_path);
base::ThreadRestrictions::ScopedAllowIO allow_io;
CHECK(base::MakeAbsoluteFilePath(command_line->GetProgram()) == child_path);

View file

@ -108,7 +108,7 @@ void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
pref_registry->RegisterFilePathPref(prefs::kSelectFileLastDirectory,
base::FilePath());
base::FilePath download_dir;
PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &download_dir);
base::PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &download_dir);
pref_registry->RegisterFilePathPref(prefs::kDownloadDefaultDirectory,
download_dir);
pref_registry->RegisterDictionaryPref(prefs::kDevToolsFileSystemPaths);

View file

@ -152,7 +152,7 @@ void Browser::DidFinishLaunching(const base::DictionaryValue& launch_info) {
// Make sure the userData directory is created.
base::ThreadRestrictions::ScopedAllowIO allow_io;
base::FilePath user_data;
if (PathService::Get(brightray::DIR_USER_DATA, &user_data))
if (base::PathService::Get(brightray::DIR_USER_DATA, &user_data))
base::CreateDirectoryAndGetError(user_data, nullptr);
is_ready_ = true;

View file

@ -45,7 +45,7 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
bool GetProcessExecPath(base::string16* exe) {
base::FilePath path;
if (!PathService::Get(base::FILE_EXE, &path)) {
if (!base::PathService::Get(base::FILE_EXE, &path)) {
LOG(ERROR) << "Error getting app exe path";
return false;
}
@ -329,7 +329,7 @@ PCWSTR Browser::GetAppUserModelID() {
std::string Browser::GetExecutableFileVersion() const {
base::FilePath path;
if (PathService::Get(base::FILE_EXE, &path)) {
if (base::PathService::Get(base::FILE_EXE, &path)) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
std::unique_ptr<FileVersionInfo> version_info(
FileVersionInfo::CreateFileVersionInfo(path));

View file

@ -42,7 +42,7 @@ bool RelaunchApp(const StringVector& argv) {
// helper process, because there's no guarantee that the updated version's
// relauncher implementation will be compatible with the running version's.
base::FilePath child_path;
if (!PathService::Get(content::CHILD_PROCESS_EXE, &child_path)) {
if (!base::PathService::Get(content::CHILD_PROCESS_EXE, &child_path)) {
LOG(ERROR) << "No CHILD_PROCESS_EXE";
return false;
}