| Index: content/browser/download/download_manager_impl.cc
|
| diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
|
| index 238508ca99da1c064a668b133e04744aa18688c0..db4abf7e31d77120c4f112cabc9dfa4c74171a11 100644
|
| --- a/content/browser/download/download_manager_impl.cc
|
| +++ b/content/browser/download/download_manager_impl.cc
|
| @@ -56,6 +56,10 @@
|
| #include "storage/browser/blob/blob_url_request_job_factory.h"
|
| #include "url/origin.h"
|
|
|
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
| +#include "base/nix/xdg_util.h"
|
| +#endif
|
| +
|
| namespace content {
|
| namespace {
|
|
|
| @@ -176,6 +180,13 @@ class DownloadItemFactoryImpl : public DownloadItemFactory {
|
| }
|
| };
|
|
|
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
| +base::FilePath GetTemporaryDownloadDirectory() {
|
| + std::unique_ptr<base::Environment> env(base::Environment::Create());
|
| + return base::nix::GetXDGDirectory(env.get(), "XDG_DATA_HOME", ".local/share");
|
| +}
|
| +#endif
|
| +
|
| } // namespace
|
|
|
| DownloadManagerImpl::DownloadManagerImpl(net::NetLog* net_log,
|
| @@ -361,12 +372,20 @@ void DownloadManagerImpl::StartDownloadWithId(
|
| }
|
|
|
| base::FilePath default_download_directory;
|
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
| + // TODO(thomasanderson): Remove this when all Linux distros with
|
| + // versions of GTK lower than 3.14.7 are no longer supported. This
|
| + // should happen when support for Ubuntu Trusty and Debian Jessie
|
| + // are removed.
|
| + default_download_directory = GetTemporaryDownloadDirectory();
|
| +#else
|
| if (delegate_) {
|
| base::FilePath website_save_directory; // Unused
|
| bool skip_dir_check = false; // Unused
|
| delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory,
|
| &default_download_directory, &skip_dir_check);
|
| }
|
| +#endif
|
|
|
| std::unique_ptr<DownloadFile> download_file;
|
|
|
|
|