Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1378)

Unified Diff: chrome/browser/download/download_prefs.cc

Issue 6973052: When the download folder does not exist, change the download folder to a user's "Downloads" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Applied Pawel's comments Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_manager_unittest.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_prefs.cc
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 01202d8f47530362fff57f34054e92079ccb9a16..833b5aa6165e68f1a69c865fc6384bdba8fcc04c 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -60,18 +60,18 @@ void DownloadPrefs::RegisterUserPrefs(PrefService* prefs) {
SavePackage::SAVE_AS_COMPLETE_HTML,
PrefService::UNSYNCABLE_PREF);
- // The default download path is userprofile\download.
- const FilePath& default_download_path =
- download_util::GetDefaultDownloadDirectory();
+ // The user's default "Downloads" folder.
+ FilePath default_download_dir =
+ download_util::GetDefaultDownloadDirectoryFromPathService();
prefs->RegisterFilePathPref(prefs::kDownloadDefaultDirectory,
- default_download_path,
+ default_download_dir,
PrefService::UNSYNCABLE_PREF);
#if defined(OS_CHROMEOS)
// Ensure that the download directory specified in the preferences exists.
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableFunction(&file_util::CreateDirectory, default_download_path));
+ NewRunnableFunction(&file_util::CreateDirectory, default_download_dir));
#endif // defined(OS_CHROMEOS)
// If the download path is dangerous we forcefully reset it. But if we do
@@ -82,7 +82,7 @@ void DownloadPrefs::RegisterUserPrefs(PrefService* prefs) {
prefs::kDownloadDefaultDirectory);
if (download_util::DownloadPathIsDangerous(current_download_dir)) {
prefs->SetFilePath(prefs::kDownloadDefaultDirectory,
- default_download_path);
+ default_download_dir);
}
prefs->SetBoolean(prefs::kDownloadDirUpgraded, true);
}
« no previous file with comments | « chrome/browser/download/download_manager_unittest.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698