#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "base/path_service.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h"
+#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/url_constants.h"
void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
pref_registry->RegisterFilePathPref(prefs::kSelectFileLastDirectory,
base::FilePath());
+ base::FilePath download_dir;
+ PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &download_dir);
pref_registry->RegisterFilePathPref(prefs::kDownloadDefaultDirectory,
- base::FilePath());
+ download_dir);
}
bool AtomBrowserContext::AllowNTLMCredentialsForDomain(const GURL& origin) {
download_manager_->GetBrowserContext());
base::FilePath default_download_path = browser_context->prefs()->GetFilePath(
prefs::kDownloadDefaultDirectory);
- // If users didn't set download path, use 'Downloads' directory by default.
- if (default_download_path.empty()) {
- auto path = download_manager_->GetBrowserContext()->GetPath();
- default_download_path = path.Append(FILE_PATH_LITERAL("Downloads"));
- }
CreateDownloadPathCallback download_path_callback =
base::Bind(&AtomDownloadManagerDelegate::OnDownloadPathGenerated,