2009-01-27 Paul Godavari <paul@chromium.org>
[WebKit-https.git] / WebCore / platform / chromium / ClipboardChromium.cpp
index 7fc156ed57e56f57211bd5ef188aa8b56c736533..2fcc6df27cc8c77b853b539af78843a73a3c6a9a 100644 (file)
@@ -268,15 +268,14 @@ static void writeImageToDataObject(ChromiumDataObject* dataObject, Element* elem
     // 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)