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

Unified Diff: content/child/web_url_loader_impl.cc

Issue 2674953003: Only generate suggested filenames when actually dragging an image. (Closed)
Patch Set: Maybe? Created 3 years, 10 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: content/child/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index d9eeca105e384e72e1f9bf865887f416954e8ada..4ec45df67211cc5d3d3d4f96cfdcb1f863a54fe6 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -1162,19 +1162,6 @@ void WebURLLoaderImpl::PopulateURLResponse(const GURL& url,
response->setHTTPStatusCode(headers->response_code());
response->setHTTPStatusText(WebString::fromLatin1(headers->GetStatusText()));
- // TODO(darin): We should leverage HttpResponseHeaders for this, and this
- // should be using the same code as ResourceDispatcherHost.
- // TODO(jungshik): Figure out the actual value of the referrer charset and
- // pass it to GetSuggestedFilename.
- std::string value;
- headers->EnumerateHeader(NULL, "content-disposition", &value);
- response->setSuggestedFileName(blink::WebString::fromUTF16(
- 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))
response->setLastModifiedDate(time_val.ToDoubleT());
@@ -1182,6 +1169,7 @@ void WebURLLoaderImpl::PopulateURLResponse(const GURL& url,
// Build up the header map.
size_t iter = 0;
std::string name;
+ std::string value;
while (headers->EnumerateHeaderLines(&iter, &name, &value)) {
response->addHTTPHeaderField(WebString::fromLatin1(name),
WebString::fromLatin1(value));

Powered by Google App Engine
This is Rietveld 408576698