Skip to content

Commit

Permalink
fix: honor user-defined Downloads directory (#29966)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Jul 6, 2021
1 parent c6e2cca commit 961ce1d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions shell/browser/electron_browser_client.cc
Expand Up @@ -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>
Expand Down

0 comments on commit 961ce1d

Please sign in to comment.