| 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 ecd6d88ca03e663cce57053be28a5cb822deef2f..02c7f12da9fe2f5b8473c908b1057d3b478d8515 100644
|
| --- a/content/browser/download/download_manager_impl.cc
|
| +++ b/content/browser/download/download_manager_impl.cc
|
| @@ -55,6 +55,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 {
|
|
|
| @@ -174,6 +178,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,
|
| @@ -359,12 +370,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;
|
|
|
|
|