diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-03-02 17:30:07 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-03-02 17:30:27 +0100 |
commit | d058d6c9df1ff866e4259ca2989ad144bb01a1e0 (patch) | |
tree | d91f8c314c20781080819d100df6a9855b30fbfd /src/core/file_picker_controller.cpp | |
parent | 0c6312dfba960365771c64b937579a40e02ea5f7 (diff) | |
parent | 3f1805f8569337a21b72324d5edad329d5dfe872 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: Iff6ab3c287c58d8ec84a1513460bfce5218e8a61
Diffstat (limited to 'src/core/file_picker_controller.cpp')
-rw-r--r-- | src/core/file_picker_controller.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp index 74b097ef6..158ff7f67 100644 --- a/src/core/file_picker_controller.cpp +++ b/src/core/file_picker_controller.cpp @@ -49,18 +49,18 @@ namespace QtWebEngineCore { -FilePickerController::FilePickerController(FileChooserMode mode, content::WebContents *contents, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent) +FilePickerController::FilePickerController(FileChooserMode mode, content::RenderFrameHost *frameHost, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject *parent) : QObject(parent) , m_defaultFileName(defaultFileName) , m_acceptedMimeTypes(acceptedMimeTypes) - , m_contents(contents) + , m_frameHost(frameHost) , m_mode(mode) { } void FilePickerController::accepted(const QStringList &files) { - FilePickerController::filesSelectedInChooser(files, m_contents); + FilePickerController::filesSelectedInChooser(files, m_frameHost); } void FilePickerController::accepted(const QVariant &files) @@ -76,12 +76,12 @@ void FilePickerController::accepted(const QVariant &files) qWarning("An unhandled type '%s' was provided in FilePickerController::accepted(QVariant)", files.typeName()); } - FilePickerController::filesSelectedInChooser(stringList, m_contents); + FilePickerController::filesSelectedInChooser(stringList, m_frameHost); } void FilePickerController::rejected() { - FilePickerController::filesSelectedInChooser(QStringList(), m_contents); + FilePickerController::filesSelectedInChooser(QStringList(), m_frameHost); } static QStringList listRecursively(const QDir &dir) @@ -103,15 +103,14 @@ ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, content::FileChooserParam ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, content::FileChooserParams::UploadFolder) ASSERT_ENUMS_MATCH(FilePickerController::Save, content::FileChooserParams::Save) -void FilePickerController::filesSelectedInChooser(const QStringList &filesList, content::WebContents *contents) +void FilePickerController::filesSelectedInChooser(const QStringList &filesList, content::RenderFrameHost *frameHost) { - content::RenderViewHost *rvh = contents->GetRenderViewHost(); - Q_ASSERT(rvh); + Q_ASSERT(frameHost); QStringList files(filesList); if (this->m_mode == UploadFolder && !filesList.isEmpty() && QFileInfo(filesList.first()).isDir()) // Enumerate the directory files = listRecursively(QDir(filesList.first())); - rvh->GetMainFrame()->FilesSelectedInChooser(toVector<content::FileChooserFileInfo>(files), static_cast<content::FileChooserParams::Mode>(this->m_mode)); + frameHost->FilesSelectedInChooser(toVector<content::FileChooserFileInfo>(files), static_cast<content::FileChooserParams::Mode>(this->m_mode)); } QStringList FilePickerController::acceptedMimeTypes() const |