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

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

Issue 8380021: Make all drag sources not depend on download_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: header path Created 9 years, 2 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_util.h ('k') | chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 7b11a123d8ae2737f17b27e71e2ba8697bd8dba6..d70d6508e864dc70394ea109ad2da8ee1a9f76c4 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -88,24 +88,6 @@ namespace download_util {
// so that the animation ends faded out.
static const int kCompleteAnimationCycles = 5;
-namespace {
-
-void GenerateFileNameInternal(const GURL& url,
- const std::string& content_disposition,
- const std::string& referrer_charset,
- const std::string& suggested_name,
- const std::string& mime_type,
- FilePath* generated_name) {
- std::string default_file_name(
- l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
-
- *generated_name = net::GenerateFileName(url, content_disposition,
- referrer_charset, suggested_name,
- mime_type, default_file_name);
-}
-
-} // namespace
-
// Download temporary file creation --------------------------------------------
class DefaultDownloadDirectory {
@@ -144,21 +126,15 @@ bool DownloadPathIsDangerous(const FilePath& download_path) {
void GenerateFileNameFromRequest(const DownloadItem& download_item,
FilePath* generated_name) {
- GenerateFileNameInternal(download_item.GetURL(),
- download_item.content_disposition(),
- download_item.referrer_charset(),
- download_item.suggested_filename(),
- download_item.mime_type(),
- generated_name);
-}
+ std::string default_file_name(
+ l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
-void GenerateFileNameFromSuggestedName(const GURL& url,
- const std::string& suggested_name,
- const std::string& mime_type,
- FilePath* generated_name) {
- // TODO(asanka): We should pass in a valid referrer_charset here.
- GenerateFileNameInternal(url, std::string(), std::string(),
- suggested_name, mime_type, generated_name);
+ *generated_name = net::GenerateFileName(download_item.GetURL(),
+ download_item.content_disposition(),
+ download_item.referrer_charset(),
+ download_item.suggested_filename(),
+ download_item.mime_type(),
+ default_file_name);
}
// Download progress painting --------------------------------------------------
« no previous file with comments | « chrome/browser/download/download_util.h ('k') | chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698