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

Unified Diff: third_party/WebKit/Source/platform/clipboard/ClipboardUtilitiesWin.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/platform/clipboard/ClipboardUtilitiesWin.cpp
diff --git a/third_party/WebKit/Source/platform/clipboard/ClipboardUtilitiesWin.cpp b/third_party/WebKit/Source/platform/clipboard/ClipboardUtilitiesWin.cpp
index 3b4bdf766d19a78acd6f87d7d386dc55d347d194..bb69b4bd3cfc5a9a894c10cf3040c1a29c55b876 100644
--- a/third_party/WebKit/Source/platform/clipboard/ClipboardUtilitiesWin.cpp
+++ b/third_party/WebKit/Source/platform/clipboard/ClipboardUtilitiesWin.cpp
@@ -33,15 +33,6 @@
namespace blink {
-// FAT32 and NTFS both limit filenames to a maximum of 255 characters.
-static const unsigned maxFilenameLength = 255;
-
-// Returns true if the specified character is not valid in a file name. This
-// is intended for use with removeCharacters.
-static bool isInvalidFileCharacter(UChar c) {
- return !(PathGetCharType(c) & (GCT_LFNCHAR | GCT_SHORTCHAR));
-}
-
void replaceNewlinesWithWindowsStyleNewlines(String& str) {
DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n"));
StringBuilder result;
@@ -54,16 +45,4 @@ void replaceNewlinesWithWindowsStyleNewlines(String& str) {
str = result.toString();
}
-void validateFilename(String& name, String& extension) {
- // Remove any invalid file system characters.
- name = name.removeCharacters(&isInvalidFileCharacter);
- extension = extension.removeCharacters(&isInvalidFileCharacter);
-
- if (extension.length() >= maxFilenameLength)
- extension = String();
-
- // Truncate overly-long filenames, reserving one character for a dot.
- name.truncate(maxFilenameLength - extension.length() - 1);
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698