+2009-01-27 Paul Godavari <paul@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23561
+ Explicitly send the MIME type from an image dragged from a web
+ page to the desktop, to Chromium so that it can properly generate
+ a file name.
+
+ * platform/chromium/ChromiumDataObject.cpp:
+ (WebCore::ChromiumDataObject::clear):
+ (WebCore::ChromiumDataObject::hasData):
+ * platform/chromium/ChromiumDataObject.h:
+ * platform/chromium/ClipboardChromium.cpp:
+ (WebCore::writeImageToDataObject):
+
2009-01-27 Mads Ager <ager@chromium.org>
Reviewed by Darin Adler.
// use the alt tag if one exists, otherwise we fall back on the suggested
// filename in the http header, and finally we resort to using the filename
// in the URL.
- String extension(".");
- extension += MIMETypeRegistry::getPreferredExtensionForMIMEType(
+ dataObject->fileExtension = ".";
+ dataObject->fileExtension += MIMETypeRegistry::getPreferredExtensionForMIMEType(
cachedImage->response().mimeType());
String title = element->getAttribute(altAttr);
if (title.isEmpty()) {
title = cachedImage->response().suggestedFilename();
- // FIXME: If title is empty, get the filename from the URL.
}
- dataObject->fileContentFilename = title + extension;
+ dataObject->fileContentFilename = title + dataObject->fileExtension;
}
void ClipboardChromium::declareAndWriteDragImage(Element* element, const KURL& url, const String& title, Frame* frame)