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

Unified Diff: Source/core/page/DragData.cpp

Issue 720403002: Let input tag filter out non-native files in dropped data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test. Created 6 years, 1 month 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
« no previous file with comments | « Source/core/page/DragData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DragData.cpp
diff --git a/Source/core/page/DragData.cpp b/Source/core/page/DragData.cpp
index 6e7e29a73f32ddcc0943bb8d8b47348255ec504f..fbb264c22eaeb2a5eb6a4ef0999c8476278de067 100644
--- a/Source/core/page/DragData.cpp
+++ b/Source/core/page/DragData.cpp
@@ -85,21 +85,18 @@ bool DragData::containsFiles() const
return m_platformDragData->containsFilenames();
}
-unsigned DragData::numberOfFiles() const
-{
- return m_platformDragData->filenames().size();
-}
-
int DragData::modifierKeyState() const
{
return m_platformDragData->modifierKeyState();
}
-void DragData::asFilenames(Vector<String>& result) const
+void DragData::asFilePaths(Vector<String>& result) const
{
const Vector<String>& filenames = m_platformDragData->filenames();
- for (size_t i = 0; i < filenames.size(); ++i)
- result.append(filenames[i]);
+ for (size_t i = 0; i < filenames.size(); ++i) {
+ if (!filenames[i].isEmpty())
+ result.append(filenames[i]);
+ }
}
bool DragData::containsPlainText() const
« no previous file with comments | « Source/core/page/DragData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698