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

Unified Diff: WebCore/platform/chromium/ClipboardChromium.cpp

Issue 28077: WebKit side of merge from r41149 to r41181. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/WebKit/
Patch Set: Created 11 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: WebCore/platform/chromium/ClipboardChromium.cpp
===================================================================
--- WebCore/platform/chromium/ClipboardChromium.cpp (revision 10232)
+++ WebCore/platform/chromium/ClipboardChromium.cpp (working copy)
@@ -268,13 +268,14 @@
// 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.
- dataObject->fileExtension = ".";
- dataObject->fileExtension += MIMETypeRegistry::getPreferredExtensionForMIMEType(
+ String extension = MIMETypeRegistry::getPreferredExtensionForMIMEType(
cachedImage->response().mimeType());
+ dataObject->fileExtension = extension.isEmpty() ? "" : "." + extension;
String title = element->getAttribute(altAttr);
- if (title.isEmpty()) {
+ if (title.isEmpty())
title = cachedImage->response().suggestedFilename();
- }
+
+ title = ClipboardChromium::validateFileName(title, dataObject);
dataObject->fileContentFilename = title + dataObject->fileExtension;
}
« no previous file with comments | « WebCore/loader/appcache/ApplicationCacheGroup.cpp ('k') | WebCore/platform/chromium/ClipboardChromiumLinux.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698