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

Unified Diff: net/base/net_util.h

Issue 7005011: Fix bug 79905: Drag and drop of "DownloadURL" type ignores specified filename for data URLs. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/ui/views/tab_contents/tab_contents_drag_win.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.h
===================================================================
--- net/base/net_util.h (revision 85826)
+++ net/base/net_util.h (working copy)
@@ -245,18 +245,19 @@
// unmodified.
NET_API string16 StripWWW(const string16& text);
-// Gets the filename from the raw Content-Disposition header (as read from the
-// network). Otherwise uses the last path component name or hostname from
-// |url|. If there is no filename or it can't be used, the given |default_name|,
-// will be used unless it is empty.
-
-// Note: it's possible for the suggested filename to be empty (e.g.,
-// file:///). referrer_charset is used as one of charsets
-// to interpret a raw 8bit string in C-D header (after interpreting
-// as UTF-8 fails). See the comment for GetFilenameFromCD for more details.
+// Gets the filename in the following order:
+// 1) the raw Content-Disposition header (as read from the network).
+// |referrer_charset| is used as one of charsets to interpret a raw 8bit
+// string in C-D header (after interpreting as UTF-8 fails).
+// See the comment for GetFilenameFromCD for more details.
+// 2) the suggested name
+// 3) the last path component name or hostname from |url|
+// 4) the given |default_name|
+// 5) the hard-coded name "download", as the last resort
NET_API string16 GetSuggestedFilename(const GURL& url,
const std::string& content_disposition,
const std::string& referrer_charset,
+ const std::string& suggested_name,
const string16& default_name);
// Checks the given port against a list of ports which are restricted by
« no previous file with comments | « chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698