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

Unified Diff: chrome/browser/download/download_util.h

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_prefs.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.h
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 50b930b49160762a9e10bbf6250499c1493abba2..de9f6db720044cc9a2638154c92281ffac557ec3 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -50,12 +50,20 @@ namespace download_util {
// Download temporary file creation --------------------------------------------
-// Return the default download directory.
-const FilePath& GetDefaultDownloadDirectory();
-
-// Create a temporary file for a download in the user's default download
-// directory and return true if was successful in creating the file.
-bool CreateTemporaryFileForDownload(FilePath* path);
+// Chooses a writable directory from |website_save_dir|, |download_save_dir|
+// and |default_download_dir| in this order of priority.
+// If none of them is writable, creates |download_save_dir| and
+// chooses |download_save_dir|. The choosed directory is stored to |save_dir|.
+// Returns true if neither |website_save_dir| nor |download_save_dir|
+// is writable, which indicates the select file dialog should be displayed.
+bool ChooseSavableDirectory(const FilePath& website_save_dir,
+ const FilePath& download_save_dir,
+ const FilePath& default_download_dir,
+ FilePath* save_dir);
+
+// Returns the user's default "Downloads" folder provided by PathService.
+// This method returns the folder provided by PathService.
+FilePath GetDefaultDownloadDirectoryFromPathService();
// Return true if the |download_path| is dangerous path.
bool DownloadPathIsDangerous(const FilePath& download_path);
« no previous file with comments | « chrome/browser/download/download_prefs.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698