From c34b72183e85e7c615ca65381d8591cdca23faf2 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Mon, 25 Nov 2013 15:38:24 +0100 Subject: [Widgets] wire the file pickers Introduce a new version of chooseFiles in QWebEnginePage. The existing API in WebKit1 seemed a bit dusty in any case (multiple only supported via extensions). Changes are: * oldFile becomes oldFiles, so that we could at a later stage expose the already selected files in the "multiple" case. * a type is introduced, for now limited to multiple selection, but over time, we might consider additions such as directory upload. Change-Id: I14cfea64ce95e892a0a1877c8cb914c5a421409f Reviewed-by: Jocelyn Turcotte --- src/core/web_contents_adapter_client.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/web_contents_adapter_client.h') diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index 72754e9dc..2231fd46b 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -45,6 +45,7 @@ #include #include +#include #include class RenderWidgetHostViewQt; @@ -99,6 +100,14 @@ public: PromptDialog }; + // Must match the ones in file_chooser_params.h + enum FileChooserMode { + Open, + OpenMultiple, + UploadFolder, + Save + }; + virtual ~WebContentsAdapterClient() { } virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) = 0; @@ -115,6 +124,7 @@ public: virtual void close() = 0; virtual bool contextMenuRequested(const WebEngineContextMenuData&) = 0; virtual bool javascriptDialog(JavascriptDialogType type, const QString &message, const QString &defaultValue = QString(), QString *result = 0) = 0; + virtual void runFileChooser(FileChooserMode, const QString &defaultFileName, const QStringList &acceptedMimeTypes) = 0; }; #endif // WEB_CONTENTS_ADAPTER_CLIENT_H -- cgit v1.2.3