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

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

Issue 3043024: Creating download directory on chromeos when its registered as the default do... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
===================================================================
--- chrome/browser/download/download_manager.cc (revision 53501)
+++ chrome/browser/download/download_manager.cc (working copy)
@@ -84,6 +84,12 @@
download_util::GetDefaultDownloadDirectory();
prefs->RegisterFilePathPref(prefs::kDownloadDefaultDirectory,
default_download_path);
+#if defined(OS_CHROMEOS)
+ // Ensure that the download directory specified in the preferences exists.
+ ChromeThread::PostTask(
+ ChromeThread::FILE, FROM_HERE,
+ NewRunnableFunction(&file_util::CreateDirectory, default_download_path));
+#endif
// If the download path is dangerous we forcefully reset it. But if we do
// so we set a flag to make sure we only do it once, to avoid fighting
@@ -342,7 +348,6 @@
prompt_for_download_.Init(prefs::kPromptForDownload, prefs, NULL);
download_path_.Init(prefs::kDownloadDefaultDirectory, prefs, NULL);
-
// Ensure that the download directory specified in the preferences exists.
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
@@ -433,10 +438,11 @@
// Determine the proper path for a download, by either one of the following:
// 1) using the default download directory.
// 2) prompting the user.
- if (info->prompt_user_for_save_location && !last_download_path_.empty())
+ if (info->prompt_user_for_save_location && !last_download_path_.empty()){
info->suggested_path = last_download_path_;
- else
+ } else {
info->suggested_path = download_path();
+ }
info->suggested_path = info->suggested_path.Append(generated_name);
} else {
info->suggested_path = info->save_info.file_path;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698