diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-07-31 11:10:26 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-03-08 13:04:27 +0000 |
commit | e5c7cc61d3696830e380a457f5bebe38757b5e54 (patch) | |
tree | aec6a85345196434f63fa44c76659e6b7350e564 | |
parent | 0ef13b2a7d4d948e0b7488f06535e357f2e83236 (diff) | |
download | qtwebengine-chromium-e5c7cc61d3696830e380a457f5bebe38757b5e54.tar.gz |
Don't use Chromium's OSExchangeDataProviderFactory::CreateProvider()
There is a Qt implementation of CreateProvider in
src/core/chromium_overrides.cpp
Change-Id: Ibc6bc4e86b7f1f0d8d80e0809d0be7fda3e6e35a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
-rw-r--r-- | chromium/components/remote_cocoa/app_shim/bridged_content_view.mm | 18 | ||||
-rw-r--r-- | chromium/ui/base/dragdrop/os_exchange_data_provider_factory.cc | 2 | ||||
-rw-r--r-- | chromium/ui/base/x/BUILD.gn | 4 |
3 files changed, 22 insertions, 2 deletions
diff --git a/chromium/components/remote_cocoa/app_shim/bridged_content_view.mm b/chromium/components/remote_cocoa/app_shim/bridged_content_view.mm index 747f789789b..fadb41c69b2 100644 --- a/chromium/components/remote_cocoa/app_shim/bridged_content_view.mm +++ b/chromium/components/remote_cocoa/app_shim/bridged_content_view.mm @@ -14,8 +14,10 @@ #import "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h" #include "components/remote_cocoa/app_shim/native_widget_ns_window_host_helper.h" #include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h" +#include "ui/base/clipboard/clipboard_constants.h" #import "ui/base/cocoa/appkit_utils.h" #include "ui/base/cocoa/cocoa_base_utils.h" +#import "ui/base/dragdrop/cocoa_dnd_util.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/os_exchange_data_provider_mac.h" #include "ui/base/ime/input_method.h" @@ -102,6 +104,18 @@ ui::TextEditCommand GetTextEditCommandForMenuAction(SEL action) { return ui::TextEditCommand::INVALID_COMMAND; } +#if defined(TOOLKIT_QT) +// Copy of ui::OSExchangeDataProviderMac::SupportedPasteboardTypes() (ui/base/dragdrop/os_exchange_data_provider_mac.mm) +NSArray* SupportedPasteboardTypes() { + return @[ + ui::kWebCustomDataPboardType, ui::ClipboardUtil::UTIForWebURLsAndTitles(), + NSURLPboardType, NSFilenamesPboardType, ui::kChromeDragDummyPboardType, + NSStringPboardType, NSHTMLPboardType, NSRTFPboardType, + NSFilenamesPboardType, ui::kWebCustomDataPboardType, NSPasteboardTypeString + ]; +} +#endif + } // namespace @interface BridgedContentView () @@ -200,8 +214,12 @@ ui::TextEditCommand GetTextEditCommandForMenuAction(SEL action) { // Initialize the focus manager with the correct keyboard accessibility // setting. [self updateFullKeyboardAccess]; +#if !defined(TOOLKIT_QT) [self registerForDraggedTypes:ui::OSExchangeDataProviderMac:: SupportedPasteboardTypes()]; +#else + [self registerForDraggedTypes:SupportedPasteboardTypes()]; +#endif } return self; } diff --git a/chromium/ui/base/dragdrop/os_exchange_data_provider_factory.cc b/chromium/ui/base/dragdrop/os_exchange_data_provider_factory.cc index 8e83dc84fc7..2414c56500e 100644 --- a/chromium/ui/base/dragdrop/os_exchange_data_provider_factory.cc +++ b/chromium/ui/base/dragdrop/os_exchange_data_provider_factory.cc @@ -18,6 +18,7 @@ namespace ui { +#if !defined(TOOLKIT_QT) // static std::unique_ptr<OSExchangeDataProvider> OSExchangeDataProviderFactory::CreateProvider() { @@ -42,5 +43,6 @@ OSExchangeDataProviderFactory::CreateProvider() { #error "Unknown operating system" #endif } +#endif // !defined(TOOLKIT_QT) } // namespace ui diff --git a/chromium/ui/base/x/BUILD.gn b/chromium/ui/base/x/BUILD.gn index 3cb5ed7a46b..c477a7a8029 100644 --- a/chromium/ui/base/x/BUILD.gn +++ b/chromium/ui/base/x/BUILD.gn @@ -77,7 +77,6 @@ component("x") { "//build:chromeos_buildflags", "//net", "//skia", - "//ui/base:data_exchange", "//ui/base:features", "//ui/base/clipboard:clipboard_types", "//ui/base/clipboard:file_info", @@ -96,7 +95,7 @@ component("x") { "//ui/platform_window/common", ] - if (is_linux || is_chromeos) { + if ((is_linux || is_chromeos) && !use_qt) { sources += [ "selection_owner.cc", "selection_owner.h", @@ -110,6 +109,7 @@ component("x") { public_deps += [ "//ui/base/dragdrop/mojom:mojom_shared" ] deps += [ "//ui/base", + "//ui/base:data_exchange", "//ui/base/dragdrop:types", "//ui/base/dragdrop/mojom", ] |