Allow WebFileChooser to return extra file info (like displayName) in addition to...
authorkinuko@chromium.org <kinuko@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 14:06:48 +0000 (14:06 +0000)
committerkinuko@chromium.org <kinuko@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 14:06:48 +0000 (14:06 +0000)
commit609518666d13ab0ff9f220293f79df85903bd4f7
treee36c4033c882018a99814e6c740c5ff905759acd
parent0dfa6fb9dbe6414c227141469e798f21ac48fada
Allow WebFileChooser to return extra file info (like displayName) in addition to mere file paths
https://bugs.webkit.org/show_bug.cgi?id=80719

Reviewed by Kent Tamura.

Source/WebCore:

No new tests: this change itself shouldn't change existing behavior.

* fileapi/File.cpp:
(WebCore::createBlobDataForFileWithName): Renamed from createBlobDataForFileSystemFile.
* fileapi/File.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::saveFormControlState): Updated to handle File.name.
(WebCore::FileInputType::restoreFormControlState): Ditto.
(WebCore::FileInputType::setFileList): Changed the signature to take
FileChooserFileInfo.
(WebCore::FileInputType::filesChosen): Ditto.
(WebCore::FileInputType::receiveDroppedFiles):
* html/FileInputType.h:
(FileInputType):
* platform/FileChooser.cpp:
(WebCore::FileChooser::chooseFiles): Added an overloaded method that
takes FileChooserFileInfo.
(WebCore):
* platform/FileChooser.h:
(WebCore::FileChooserFileInfo::FileChooserFileInfo): Added.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::getWellKnownMIMETypeForExtension): Removed surrouonding ifdefs as this function is now used even if FILE_SYSTEM is not enabled.
* platform/MIMETypeRegistry.h:
(MIMETypeRegistry):

Source/WebKit/chromium:

* public/WebFileChooserCompletion.h:
(SelectedFileInfo): Added.
(WebFileChooserCompletion):
(WebKit::WebFileChooserCompletion::didChooseFile): Added an overloaded
method that takes SelectedFileInfo.
* src/WebFileChooserCompletionImpl.cpp:
(WebKit::WebFileChooserCompletionImpl::didChooseFile): Ditto.
(WebKit):
* src/WebFileChooserCompletionImpl.h:
(WebFileChooserCompletionImpl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/fileapi/File.cpp
Source/WebCore/fileapi/File.h
Source/WebCore/html/FileInputType.cpp
Source/WebCore/html/FileInputType.h
Source/WebCore/platform/FileChooser.cpp
Source/WebCore/platform/FileChooser.h
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/MIMETypeRegistry.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebFileChooserCompletion.h
Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp
Source/WebKit/chromium/src/WebFileChooserCompletionImpl.h