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

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

Issue 7300005: Move filename determination to net_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 9 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
Index: chrome/browser/download/download_util.h
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 90f669ab2f7ae7b9133bf686a10fa65c184be026..3c6102c33a3b4e61243573549a3ff5fb79a6cccc 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -60,34 +60,23 @@ bool CreateTemporaryFileForDownload(FilePath* path);
// Return true if the |download_path| is dangerous path.
bool DownloadPathIsDangerous(const FilePath& download_path);
-// Create an extension based on the file name and mime type.
-void GenerateExtension(const FilePath& file_name,
- const std::string& mime_type,
- FilePath::StringType* generated_extension);
-
-// Create a file name based on the response from the server.
+// Generate a filename based on the response from the server. Similar
+// in operation to net::GenerateFileName(), but uses a localized
+// default name.
void GenerateFileNameFromRequest(const GURL& url,
const std::string& content_disposition,
const std::string& referrer_charset,
const std::string& mime_type,
FilePath* generated_name);
+// Generate a filename based on the URL, a suggested name and a MIME
+// type. Similar in operation to net::GenerateFileName(), but uses a
+// localized default name.
void GenerateFileNameFromSuggestedName(const GURL& url,
const std::string& suggested_name,
const std::string& mime_type,
FilePath* generated_name);
-void GenerateFileName(const GURL& url,
- const std::string& content_disposition,
- const std::string& referrer_charset,
- const std::string& mime_type,
- FilePath* generated_name);
-
-// Used to make sure we have a safe file extension and filename for a
-// download. |file_name| can either be just the file name or it can be a
-// full path to a file.
-void GenerateSafeFileName(const std::string& mime_type, FilePath* file_name);
-
// Download progress animations ------------------------------------------------
// Arc sweep angle for use with downloads of unknown size
@@ -270,10 +259,6 @@ void NotifyDownloadInitiated(int render_process_id, int render_view_id);
// a number, -1 is returned.
int GetUniquePathNumberWithCrDownload(const FilePath& path);
-// Erases all downloaded files with the specified path and name prefix.
-// Used by download UI tests to clean up the download directory.
-void EraseUniqueDownloadFiles(const FilePath& path_prefix);
-
// Returns a .crdownload intermediate path for the |suggested_path|.
FilePath GetCrDownloadPath(const FilePath& suggested_path);

Powered by Google App Engine
This is Rietveld 408576698