From 2dfcbefcf321160fb1ef4766571db833f8e5e319 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 6 Jul 2021 10:32:44 +0900 Subject: [PATCH] fix: honor user-defined Downloads directory (#29967) Co-authored-by: Shelley Vohr --- shell/browser/electron_browser_client.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 35935060e901c..8f9544f27147a 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -1017,12 +1017,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