| Index: third_party/WebKit/Source/core/html/forms/FileInputType.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/forms/FileInputType.cpp b/third_party/WebKit/Source/core/html/forms/FileInputType.cpp
|
| index 3bae496cd71ba5878d044be047db4c84553ceffb..98353fbca72a2cd287551efe12602637088a6d75 100644
|
| --- a/third_party/WebKit/Source/core/html/forms/FileInputType.cpp
|
| +++ b/third_party/WebKit/Source/core/html/forms/FileInputType.cpp
|
| @@ -317,30 +317,34 @@
|
| setFiles(createFileList(files, element().fastHasAttribute(webkitdirectoryAttr)));
|
| }
|
|
|
| -void FileInputType::setFilesFromDirectory(const String& path)
|
| +void FileInputType::receiveDropForDirectoryUpload(const Vector<String>& paths)
|
| {
|
| if (ChromeClient* chromeClient = this->chromeClient()) {
|
| FileChooserSettings settings;
|
| HTMLInputElement& input = element();
|
| settings.allowsDirectoryUpload = true;
|
| settings.allowsMultipleFiles = true;
|
| - settings.selectedFiles.append(path);
|
| + settings.selectedFiles.append(paths[0]);
|
| settings.acceptMIMETypes = input.acceptMIMETypes();
|
| settings.acceptFileExtensions = input.acceptFileExtensions();
|
| chromeClient->enumerateChosenDirectory(newFileChooser(settings));
|
| }
|
| }
|
|
|
| -void FileInputType::setFilesFromPaths(const Vector<String>& paths)
|
| -{
|
| +bool FileInputType::receiveDroppedFiles(const DragData* dragData)
|
| +{
|
| + Vector<String> paths;
|
| + dragData->asFilePaths(paths);
|
| if (paths.isEmpty())
|
| - return;
|
| + return false;
|
|
|
| HTMLInputElement& input = element();
|
| if (input.fastHasAttribute(webkitdirectoryAttr)) {
|
| - setFilesFromDirectory(paths[0]);
|
| - return;
|
| - }
|
| + receiveDropForDirectoryUpload(paths);
|
| + return true;
|
| + }
|
| +
|
| + m_droppedFileSystemId = dragData->droppedFileSystemId();
|
|
|
| Vector<FileChooserFileInfo> files;
|
| for (unsigned i = 0; i < paths.size(); ++i)
|
| @@ -353,19 +357,6 @@
|
| firstFileOnly.append(files[0]);
|
| filesChosen(firstFileOnly);
|
| }
|
| -}
|
| -
|
| -bool FileInputType::receiveDroppedFiles(const DragData* dragData)
|
| -{
|
| - Vector<String> paths;
|
| - dragData->asFilePaths(paths);
|
| - if (paths.isEmpty())
|
| - return false;
|
| -
|
| - if (!element().fastHasAttribute(webkitdirectoryAttr)) {
|
| - m_droppedFileSystemId = dragData->droppedFileSystemId();
|
| - }
|
| - setFilesFromPaths(paths);
|
| return true;
|
| }
|
|
|
|
|