diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp index d7583c5dd..73452d0d0 100644 --- a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp @@ -44,14 +44,20 @@ WebFileChooserCompletionImpl::~WebFileChooserCompletionImpl() void WebFileChooserCompletionImpl::didChooseFile(const WebVector<WebString>& fileNames) { - if (fileNames.size() == 1) - m_fileChooser->chooseFile(fileNames[0]); - else if (fileNames.size() > 0) { - Vector<WTF::String> paths; - for (size_t i = 0; i < fileNames.size(); ++i) - paths.append(fileNames[i]); - m_fileChooser->chooseFiles(paths); - } + Vector<WebCore::FileChooserFileInfo> fileInfo; + for (size_t i = 0; i < fileNames.size(); ++i) + fileInfo.append(WebCore::FileChooserFileInfo(fileNames[i])); + m_fileChooser->chooseFiles(fileInfo); + // This object is no longer needed. + delete this; +} + +void WebFileChooserCompletionImpl::didChooseFile(const WebVector<SelectedFileInfo>& files) +{ + Vector<WebCore::FileChooserFileInfo> fileInfo; + for (size_t i = 0; i < files.size(); ++i) + fileInfo.append(WebCore::FileChooserFileInfo(files[i].path, files[i].displayName)); + m_fileChooser->chooseFiles(fileInfo); // This object is no longer needed. delete this; } |