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

Unified Diff: content/browser/download/save_file.cc

Issue 10905284: Use the user's preferred downloads directory for creating the initial download file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
Index: content/browser/download/save_file.cc
diff --git a/content/browser/download/save_file.cc b/content/browser/download/save_file.cc
index b4474d10df9700348856e5e3a39be2c22a813619..b0bd5b403030846e4e090555391c61b3ee62bca3 100644
--- a/content/browser/download/save_file.cc
+++ b/content/browser/download/save_file.cc
@@ -6,12 +6,19 @@
#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/content_browser_client.h"
#include "net/base/file_stream.h"
using content::BrowserThread;
+// TODO(asanka): SaveFile should use the target directory of the save package as
+// the default download directory when initializing |file_|.
+// Unfortunately, as it is, constructors of SaveFile doesn't
+// always have access to the SavePackage at this point.
SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash)
- : file_(FilePath(),
+ : file_(content::GetContentClient()->browser()->
+ GetDefaultDownloadDirectory(),
Randy Smith (Not in Mondays) 2012/09/14 16:38:16 Is this safe to access on the file thread?
asanka 2012/09/14 19:11:45 It's documented as "can be called on any thread."
+ FilePath(),
info->url,
GURL(),
0,

Powered by Google App Engine
This is Rietveld 408576698