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

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

Issue 2674953003: Only generate suggested filenames when actually dragging an image. (Closed)
Patch Set: rebase 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: third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp
diff --git a/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp b/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp
index 1b1acdeb3354489900e86946181af37982666295..a2c985c725d88272ce045544e0a31a4f03ac985a 100644
--- a/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp
+++ b/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp
@@ -33,6 +33,7 @@
#include "core/clipboard/Pasteboard.h"
#include "core/fileapi/Blob.h"
#include "platform/clipboard/ClipboardMimeTypes.h"
+#include "platform/network/mime/MIMETypeRegistry.h"
#include "public/platform/Platform.h"
#include "public/platform/WebClipboard.h"
@@ -77,11 +78,18 @@ DataObjectItem* DataObjectItem::createFromHTML(const String& html,
}
DataObjectItem* DataObjectItem::createFromSharedBuffer(
- const String& name,
- PassRefPtr<SharedBuffer> buffer) {
- DataObjectItem* item = new DataObjectItem(FileKind, String());
+ PassRefPtr<SharedBuffer> buffer,
+ const KURL& sourceURL,
+ const String& filenameExtension,
+ const AtomicString& contentDisposition) {
+ DataObjectItem* item = new DataObjectItem(
+ FileKind,
+ MIMETypeRegistry::getWellKnownMIMETypeForExtension(filenameExtension));
item->m_sharedBuffer = buffer;
- item->m_title = name;
+ item->m_filenameExtension = filenameExtension;
+ // TODO(dcheng): Rename these fields to be more generically named.
+ item->m_title = contentDisposition;
+ item->m_baseURL = sourceURL;
return item;
}
« no previous file with comments | « third_party/WebKit/Source/core/clipboard/DataObjectItem.h ('k') | third_party/WebKit/Source/core/clipboard/DataTransfer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698