fix: honor user-defined Downloads directory (#29966)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2021-07-06 10:33:11 +09:00
committed by GitHub
parent c6e2cca8bc
commit 961ce1ded1

View File

@@ -1232,12 +1232,10 @@ ElectronBrowserClient::GetPlatformNotificationService(
}
base::FilePath ElectronBrowserClient::GetDefaultDownloadDirectory() {
// ~/Downloads
base::FilePath path;
if (base::PathService::Get(base::DIR_HOME, &path))
path = path.Append(FILE_PATH_LITERAL("Downloads"));
return path;
base::FilePath download_path;
if (base::PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &download_path))
return download_path;
return base::FilePath();
}
scoped_refptr<network::SharedURLLoaderFactory>