0

Always make an attempt to fill in the suggested filename.

BUG=35811
TEST=drag the [Next] image from http://www-sul.stanford.edu/tools/tutorials/html2.0/img.html and drop it on the desktop; the resulting file should be named "nextbtn.gif", not "tables.gif"


Review URL: https://chromiumcodereview.appspot.com/11790003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175502 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
avi@chromium.org
2013-01-08 08:44:01 +00:00
parent b502ed46c3
commit 1e67e51a09

@ -246,10 +246,14 @@ void PopulateURLResponse(
// TODO(jungshik): Figure out the actual value of the referrer charset and
// pass it to GetSuggestedFilename.
std::string value;
if (headers->EnumerateHeader(NULL, "content-disposition", &value)) {
response->setSuggestedFileName(
net::GetSuggestedFilename(url, value, "", "", "", std::string()));
}
headers->EnumerateHeader(NULL, "content-disposition", &value);
response->setSuggestedFileName(
net::GetSuggestedFilename(url,
value,
std::string(), // referrer_charset
std::string(), // suggested_name
std::string(), // mime_type
std::string())); // default_name
Time time_val;
if (headers->GetLastModifiedValue(&time_val))