From 46a2f0f3137dcb46f2752130bbee6438742c27ac Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Fri, 11 Jun 2021 16:25:20 +0200 Subject: Implement dialogs of File System Access API Dialogs triggered by window.showOpenFilePicker() or window.showDirectoryPicker() needed different implementation than regular file picker dialogs. Since the end-users can't distinguish between HTML file picker dialogs and these file system access dialogs, we can just use the existing file picker WebEngine API and UI delegates. Task-number: QTBUG-92519 Pick-to: 6.2 Change-Id: Ib1624f80603c4042803303274ba45d864ecb371c Reviewed-by: Allan Sandfeld Jensen --- src/core/content_browser_client_qt.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/content_browser_client_qt.cpp') diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index fdcd98024..f17bc5025 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -106,6 +106,7 @@ #include "profile_io_data_qt.h" #include "quota_permission_context_qt.h" #include "renderer_host/user_resource_controller_host.h" +#include "select_file_dialog_factory_qt.h" #include "type_conversion.h" #include "web_contents_adapter_client.h" #include "web_contents_adapter.h" @@ -391,6 +392,12 @@ void ContentBrowserClientQt::GetAdditionalAllowedSchemesForFileSystem(std::vecto additional_schemes->push_back(content::kChromeUIScheme); } +std::unique_ptr +ContentBrowserClientQt::CreateSelectFilePolicy(content::WebContents *web_contents) +{ + return std::make_unique(web_contents); +} + #if defined(Q_OS_LINUX) void ContentBrowserClientQt::GetAdditionalMappedFilesForChildProcess(const base::CommandLine& command_line, int child_process_id, content::PosixFileDescriptorInfo* mappings) { -- cgit v1.2.3