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

Unified Diff: third_party/WebKit/Source/core/clipboard/DataTransfer.cpp

Issue 2398053003: Compute ResourceResponse::suggestedFileName on the fly. (Closed)
Patch Set: clean up vestigial changes (trybots previous) Created 4 years, 2 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: third_party/WebKit/Source/core/clipboard/DataTransfer.cpp
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp
index 66b9457b48a42b0fc524b5e73851c94df520491c..cc579d1d50a5558b64b4293f66ef4a56a77c1cb0 100644
--- a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp
+++ b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp
@@ -43,6 +43,7 @@
#include "platform/MIMETypeRegistry.h"
#include "platform/clipboard/ClipboardMimeTypes.h"
#include "platform/clipboard/ClipboardUtilities.h"
+#include "platform/network/NetworkUtils.h"
#include <memory>
namespace blink {
@@ -276,8 +277,8 @@ static void writeImageToDataObject(DataObject* dataObject,
String imageExtension = cachedImage->getImage()->filenameExtension();
ASSERT(!imageExtension.isEmpty());
- // Determine the filename for the file contents of the image.
- String filename = cachedImage->response().suggestedFilename();
+ String filename = NetworkUtils::getSuggestedFilename(
+ url, cachedImage->response().httpHeaderField("content-disposition"));
if (filename.isEmpty())
filename = url.lastPathComponent();
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | third_party/WebKit/Source/platform/exported/WebURLResponse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698