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

Side by Side Diff: chrome/browser/download/download_util.h

Issue 7484061: Use the suggested name from an anchor's 'download' attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2011 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Download utilities. 5 // Download utilities.
6 6
7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ 7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_
8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ 8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_
9 #pragma once 9 #pragma once
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // Return true if the |download_path| is dangerous path. 60 // Return true if the |download_path| is dangerous path.
61 bool DownloadPathIsDangerous(const FilePath& download_path); 61 bool DownloadPathIsDangerous(const FilePath& download_path);
62 62
63 // Create an extension based on the file name and mime type. 63 // Create an extension based on the file name and mime type.
64 void GenerateExtension(const FilePath& file_name, 64 void GenerateExtension(const FilePath& file_name,
65 const std::string& mime_type, 65 const std::string& mime_type,
66 FilePath::StringType* generated_extension); 66 FilePath::StringType* generated_extension);
67 67
68 // Create a file name based on the response from the server. 68 // Create a file name based on the response from the server.
69 void GenerateFileNameFromRequest(const GURL& url, 69 void GenerateFileNameFromRequest(const DownloadItem& download_item,
70 const std::string& content_disposition,
71 const std::string& referrer_charset,
72 const std::string& mime_type,
73 FilePath* generated_name); 70 FilePath* generated_name);
74 71
75 void GenerateFileNameFromSuggestedName(const GURL& url, 72 void GenerateFileNameFromSuggestedName(const GURL& url,
76 const std::string& suggested_name, 73 const std::string& suggested_name,
77 const std::string& mime_type, 74 const std::string& mime_type,
78 FilePath* generated_name); 75 FilePath* generated_name);
79 76
80 void GenerateFileName(const GURL& url, 77 void GenerateFileName(const GURL& url,
81 const std::string& content_disposition, 78 const std::string& content_disposition,
82 const std::string& referrer_charset, 79 const std::string& referrer_charset,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // Erases all downloaded files with the specified path and name prefix. 270 // Erases all downloaded files with the specified path and name prefix.
274 // Used by download UI tests to clean up the download directory. 271 // Used by download UI tests to clean up the download directory.
275 void EraseUniqueDownloadFiles(const FilePath& path_prefix); 272 void EraseUniqueDownloadFiles(const FilePath& path_prefix);
276 273
277 // Returns a .crdownload intermediate path for the |suggested_path|. 274 // Returns a .crdownload intermediate path for the |suggested_path|.
278 FilePath GetCrDownloadPath(const FilePath& suggested_path); 275 FilePath GetCrDownloadPath(const FilePath& suggested_path);
279 276
280 } // namespace download_util 277 } // namespace download_util
281 278
282 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ 279 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698