Skip to content

Commit

Permalink
fix: honor user-defined Downloads directory
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 29, 2021
1 parent 1b4ce6c commit 58f69e4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions shell/browser/electron_browser_client.cc
Expand Up @@ -27,6 +27,7 @@
#include "base/task/post_task.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version.h"
#include "components/net_log/chrome_net_log.h"
Expand Down Expand Up @@ -1017,12 +1018,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 (!chrome::GetUserDownloadsDirectory(&download_path))
return base::FilePath();
return download_path;
}

scoped_refptr<network::SharedURLLoaderFactory>
Expand Down

0 comments on commit 58f69e4

Please sign in to comment.