summaryrefslogtreecommitdiffstats
path: root/src/core/file_picker_controller.h
diff options
context:
space:
mode:
authorViktor Engelmann <viktor.engelmann@qt.io>2017-02-28 12:56:42 +0100
committerViktor Engelmann <viktor.engelmann@qt.io>2017-02-28 12:14:33 +0000
commit3f1805f8569337a21b72324d5edad329d5dfe872 (patch)
treeb8f403bd9f85269ac4475b1e6c0064a646de84d7 /src/core/file_picker_controller.h
parent47b498b1d05a5f13e8af8241fb6df9d09a631595 (diff)
Pass <input type="file"> result to correct RenderFrameHost
In WebContentsDelegateQt::RunFileChooser, we get a content::RenderFrameHost*, to which chromium wants us to pass the files that were selected. We now store that pointer in the FilePickerController, so that we can pass the files there in FilePickerController::filesSelectedInChooser. The attribute content::WebContents *m_contents is no longer needed then, because that was only used to obtain the main frame to which the files were sent (this caused problems when the file input was inside an iframe - we sent the result to the wrong frame in that case, so the file input object remained blocked). Task-number: QTBUG-59168 Change-Id: Ic2fdacb225e5a1a9e46ced6a1e4a9ff428f18a62 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/file_picker_controller.h')
-rw-r--r--src/core/file_picker_controller.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_picker_controller.h b/src/core/file_picker_controller.h
index 14e8de42d..66f28c3fc 100644
--- a/src/core/file_picker_controller.h
+++ b/src/core/file_picker_controller.h
@@ -45,7 +45,7 @@
#include <QStringList>
namespace content {
- class WebContents;
+ class RenderFrameHost;
}
namespace QtWebEngineCore {
@@ -60,7 +60,7 @@ public:
Save
};
- FilePickerController(FileChooserMode mode, content::WebContents *contents, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject * = 0);
+ FilePickerController(FileChooserMode mode, content::RenderFrameHost *contents, const QString &defaultFileName, const QStringList &acceptedMimeTypes, QObject * = 0);
QStringList acceptedMimeTypes() const;
QString defaultFileName() const;
FileChooserMode mode() const;
@@ -71,10 +71,10 @@ public Q_SLOTS:
void rejected();
private:
- void filesSelectedInChooser(const QStringList &filesList, content::WebContents *contents);
+ void filesSelectedInChooser(const QStringList &filesList, content::RenderFrameHost *contents);
QString m_defaultFileName;
QStringList m_acceptedMimeTypes;
- content::WebContents *m_contents;
+ content::RenderFrameHost *m_frameHost;
FileChooserMode m_mode;
};