diff --git a/src/core/accessibility_tree_formatter_qt.cpp b/src/core/accessibility_tree_formatter_qt.cpp index 6ca8637e942..08e3734106f 100644 --- a/src/core/accessibility_tree_formatter_qt.cpp +++ b/src/core/accessibility_tree_formatter_qt.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#include "content/browser/accessibility/accessibility_tree_formatter_base.h" +#include "ui/accessibility/platform/inspect/ax_tree_formatter_base.h" #include @@ -47,6 +47,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "content/public/browser/ax_inspect_factory.h" #include "browser_accessibility_qt.h" #include "api/qtwebenginecoreglobal_p.h" @@ -54,19 +55,20 @@ namespace content { #if QT_CONFIG(accessibility) -class AccessibilityTreeFormatterQt : public AccessibilityTreeFormatterBase { +class AccessibilityTreeFormatterQt : public ui::AXTreeFormatterBase { public: explicit AccessibilityTreeFormatterQt(); ~AccessibilityTreeFormatterQt() override; - base::Value BuildTreeForSelector(const AXTreeSelector&) const override { return {}; } + base::Value BuildTreeForSelector(const ui::AXTreeSelector&) const override { return {}; } base::Value BuildTreeForWindow(gfx::AcceleratedWidget widget) const override { return {}; } - std::unique_ptr BuildAccessibilityTree(content::BrowserAccessibility *) override; + base::Value BuildTree(ui::AXPlatformNodeDelegate* root) const override { return {}; } + std::unique_ptr BuildAccessibilityTree(content::BrowserAccessibility *); private: void RecursiveBuildAccessibilityTree(const content::BrowserAccessibility &node, base::DictionaryValue *dict) const; void AddProperties(const BrowserAccessibility &node, base::DictionaryValue *dict) const; - std::string ProcessTreeForOutput(const base::DictionaryValue &node, base::DictionaryValue * = nullptr) override; + std::string ProcessTreeForOutput(const base::DictionaryValue &node) const override; }; AccessibilityTreeFormatterQt::AccessibilityTreeFormatterQt() @@ -166,7 +168,7 @@ void AccessibilityTreeFormatterQt::AddProperties(const BrowserAccessibility &nod dict->SetString("description", acc_node->text(QAccessible::Description).toStdString()); } -std::string AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::DictionaryValue &node, base::DictionaryValue *) +std::string AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::DictionaryValue &node) const { std::string error_value; if (node.GetString("error", &error_value)) @@ -206,7 +208,13 @@ std::string AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::Dicti #endif // QT_CONFIG(accessibility) // static -std::unique_ptr AccessibilityTreeFormatter::Create() +std::unique_ptr AXInspectFactory::CreatePlatformFormatter() { + // Type doesn't matter + return CreateFormatter(kBlink); +} + +// static +std::unique_ptr AXInspectFactory::CreateFormatter(AXInspectFactory::Type type) { #if QT_CONFIG(accessibility) return std::unique_ptr(new AccessibilityTreeFormatterQt()); diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp index 2630ff88902..a471c5fa9fd 100644 --- a/src/core/browser_accessibility_manager_qt.cpp +++ b/src/core/browser_accessibility_manager_qt.cpp @@ -46,6 +46,23 @@ using namespace blink; namespace content { +// // static +// ui::AXTreeUpdate BrowserAccessibilityManager::GetEmptyDocument() { +// ui::AXNodeData empty_document; +// empty_document.id = 1; +// empty_document.role = ax::mojom::Role::kRootWebArea; +// ui::AXTreeUpdate update; +// update.root_id = empty_document.id; +// update.nodes.push_back(empty_document); +// return update; +// } + +// static +BrowserAccessibilityManager* BrowserAccessibilityManager::Create( + BrowserAccessibilityDelegate* delegate) { + return new BrowserAccessibilityManagerQt(nullptr, BrowserAccessibilityManager::GetEmptyDocument(), delegate); +} + BrowserAccessibilityManager* BrowserAccessibilityManager::Create( const ui::AXTreeUpdate& initialTree, BrowserAccessibilityDelegate* delegate) diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp index fabad06093c..2053aaae6ed 100644 --- a/src/core/browser_accessibility_qt.cpp +++ b/src/core/browser_accessibility_qt.cpp @@ -218,7 +218,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const // Used by Chromium to distinguish between the root of the tree // for this page, and a web area for a frame within this page. - case ax::mojom::Role::kWebArea: case ax::mojom::Role::kWebView: case ax::mojom::Role::kRootWebArea: // not sure if we need to make a diff here, but this seems common return QAccessible::WebDocument; @@ -488,7 +487,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const case ax::mojom::Role::kSection: return QAccessible::Section; case ax::mojom::Role::kSlider: - case ax::mojom::Role::kSliderThumb: return QAccessible::Slider; case ax::mojom::Role::kSpinButton: return QAccessible::SpinBox; diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp index 1add722a576..91efad073a1 100644 --- a/src/core/browser_main_parts_qt.cpp +++ b/src/core/browser_main_parts_qt.cpp @@ -55,8 +55,6 @@ #include "content/public/browser/browser_main_parts.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" -#include "content/public/browser/system_connector.h" -#include "content/public/common/service_manager_connection.h" #include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/common/constants.h" diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp index 121f664e9d7..3e2f428e75e 100644 --- a/src/core/chromium_overrides.cpp +++ b/src/core/chromium_overrides.cpp @@ -42,6 +42,7 @@ #include "web_contents_view_qt.h" #include "base/values.h" +#include "content/browser/accessibility/accessibility_event_recorder.h" #include "content/browser/accessibility/accessibility_tree_formatter_blink.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/web_contents/web_contents_impl.h" @@ -136,15 +137,17 @@ ActivationClient *GetActivationClient(aura::Window *) } // namespace wm #endif // defined(USE_AURA) || defined(USE_OZONE) +#if TEST_PASSES namespace content { -std::vector AccessibilityTreeFormatter::GetTestPasses() +std::vector AccessibilityEventRecorder::GetTestPasses() { return { - {"blink", &AccessibilityTreeFormatterBlink::CreateBlink, nullptr}, - {"native", &AccessibilityTreeFormatter::Create, nullptr}, + {"blink", &AccessibilityEventRecorder::Create}, + {"native", &AccessibilityEventRecorder::Create}, }; } } // namespace content +#endif #if defined(USE_AURA) namespace ui { diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 26d0dcf7d12..0223c895d36 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -25,7 +25,7 @@ qtConfig(webengine-embedded-build) { qtConfig(webengine-ozone-x11) { gn_args += ozone_platform_x11=true gn_args += use_xkbcommon=true - packagesExist(xscrnsaver): gn_args += use_xscrnsaver=true +# packagesExist(xscrnsaver): gn_args += use_xscrnsaver=true qtConfig(webengine-webrtc): gn_args += rtc_use_x11=true } diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index d1fb8bde7aa..a814f789f59 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -45,6 +45,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "base/threading/thread_restrictions.h" +#include "chromecast/browser/service_manager_connection.h" #include "chrome/browser/custom_handlers/protocol_handler_registry.h" #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" #if QT_CONFIG(webengine_spellchecker) @@ -77,8 +78,7 @@ #include "content/public/browser/web_ui_url_loader_factory.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" -#include "content/public/common/service_manager_connection.h" -#include "content/public/common/service_names.mojom.h" +// #include "content/public/common/service_names.mojom.h" #include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" #include "media/media_buildflags.h" @@ -637,31 +637,31 @@ void ContentBrowserClientQt::ExposeInterfacesToRenderer(service_manager::BinderR performance_manager::PerformanceManagerRegistry::GetInstance()->CreateProcessNodeAndExposeInterfacesToRendererProcess(registry, render_process_host); } -void ContentBrowserClientQt::RunServiceInstance(const service_manager::Identity &identity, - mojo::PendingReceiver *receiver) -{ -#if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) - if (identity.name() == media::mojom::kMediaServiceName) { - service_manager::Service::RunAsyncUntilTermination(media::CreateMediaService(std::move(*receiver))); - return; - } -#endif +// void ContentBrowserClientQt::RunServiceInstance(const service_manager::Identity &identity, +// mojo::PendingReceiver *receiver) +// { +// #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) +// if (identity.name() == media::mojom::kMediaServiceName) { +// service_manager::Service::RunAsyncUntilTermination(media::CreateMediaService(std::move(*receiver))); +// return; +// } +// #endif - content::ContentBrowserClient::RunServiceInstance(identity, receiver); -} +// content::ContentBrowserClient::RunServiceInstance(identity, receiver); +// } -base::Optional ContentBrowserClientQt::GetServiceManifestOverlay(base::StringPiece name) -{ - if (name == content::mojom::kBrowserServiceName) - return GetQtWebEngineContentBrowserOverlayManifest(); +// base::Optional ContentBrowserClientQt::GetServiceManifestOverlay(base::StringPiece name) +// { +// if (name == content::mojom::kBrowserServiceName) +// return GetQtWebEngineContentBrowserOverlayManifest(); - return base::nullopt; -} +// return base::nullopt; +// } -std::vector ContentBrowserClientQt::GetExtraServiceManifests() -{ - return { }; -} +// std::vector ContentBrowserClientQt::GetExtraServiceManifests() +// { +// return { }; +// } bool ContentBrowserClientQt::CanCreateWindow( content::RenderFrameHost* opener, @@ -722,8 +722,7 @@ bool ContentBrowserClientQt::ShouldEnableStrictSiteIsolation() bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(network::mojom::RestrictedCookieManagerRole role, content::BrowserContext *browser_context, const url::Origin & /*origin*/, - const net::SiteForCookies & /*site_for_cookies*/, - const url::Origin & /*top_frame_origin*/, + const net::IsolationInfo& /*isolation_info*/, bool is_service_worker, int process_id, int routing_id, diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index 4d8fe7dd3c9..962ad8775bf 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -117,14 +117,14 @@ class ContentBrowserClientQt : public content::ContentBrowserClient mojo::GenericPendingReceiver receiver) override; void RegisterBrowserInterfaceBindersForFrame(content::RenderFrameHost *render_frame_host, mojo::BinderMapWithContext *map) override; - void RunServiceInstance(const service_manager::Identity &identity, - mojo::PendingReceiver *receiver) override; + // void RunServiceInstance(const service_manager::Identity &identity, + // mojo::PendingReceiver *receiver) override; void ExposeInterfacesToRenderer(service_manager::BinderRegistry *registry, blink::AssociatedInterfaceRegistry *associated_registry, content::RenderProcessHost *render_process_host) override; - std::vector GetExtraServiceManifests() override; - base::Optional GetServiceManifestOverlay(base::StringPiece name) override; + // std::vector GetExtraServiceManifests() override; + // base::Optional GetServiceManifestOverlay(base::StringPiece name) override; bool CanCreateWindow(content::RenderFrameHost *opener, const GURL &opener_url, const GURL &opener_top_level_frame_url, @@ -144,8 +144,7 @@ class ContentBrowserClientQt : public content::ContentBrowserClient network::mojom::RestrictedCookieManagerRole role, content::BrowserContext *browser_context, const url::Origin &origin, - const net::SiteForCookies &site_for_cookies, - const url::Origin &top_frame_origin, + const net::IsolationInfo& isolation_info, bool is_service_worker, int process_id, int routing_id, diff --git a/src/core/extensions/extensions_browser_client_qt.cpp b/src/core/extensions/extensions_browser_client_qt.cpp index e59e83f7f1d..0efa6ff9ef3 100644 --- a/src/core/extensions/extensions_browser_client_qt.cpp +++ b/src/core/extensions/extensions_browser_client_qt.cpp @@ -361,8 +361,8 @@ void ExtensionsBrowserClientQt::LoadResourceFromResourceBundle(const network::Re } -bool ExtensionsBrowserClientQt::AllowCrossRendererResourceLoad(const GURL &url, - blink::mojom::ResourceType resource_type, +bool ExtensionsBrowserClientQt::AllowCrossRendererResourceLoad(const network::ResourceRequest& request, + network::mojom::RequestDestination destination, ui::PageTransition page_transition, int child_id, bool is_incognito, @@ -375,7 +375,7 @@ bool ExtensionsBrowserClientQt::AllowCrossRendererResourceLoad(const GURL &url, return true; bool allowed = false; - if (url_request_util::AllowCrossRendererResourceLoad(url, resource_type, + if (url_request_util::AllowCrossRendererResourceLoad(request, destination, page_transition, child_id, is_incognito, extension, extensions, process_map, &allowed)) { diff --git a/src/core/extensions/extensions_browser_client_qt.h b/src/core/extensions/extensions_browser_client_qt.h index 5889694b75b..3d7a669428c 100644 --- a/src/core/extensions/extensions_browser_client_qt.h +++ b/src/core/extensions/extensions_browser_client_qt.h @@ -75,8 +75,8 @@ class ExtensionsBrowserClientQt : public ExtensionsBrowserClient bool IsGuestSession(content::BrowserContext *context) const override; bool IsExtensionIncognitoEnabled(const std::string &extension_id, content::BrowserContext *context) const override; bool CanExtensionCrossIncognito(const Extension *extension, content::BrowserContext *context) const override; - bool AllowCrossRendererResourceLoad(const GURL &url, - blink::mojom::ResourceType resource_type, + bool AllowCrossRendererResourceLoad(const network::ResourceRequest& request, + network::mojom::RequestDestination destination, ui::PageTransition page_transition, int child_id, bool is_incognito, diff --git a/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp b/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp index 58f4f209a4f..cafb38d02e4 100644 --- a/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp +++ b/src/core/extensions/mime_handler_view_guest_delegate_qt.cpp @@ -65,8 +65,7 @@ bool MimeHandlerViewGuestDelegateQt::HandleContextMenu(content::WebContents *web { content::ContextMenuParams new_params = params; - gfx::Point guest_coordinates = - static_cast(web_contents)->GetBrowserPluginGuest()->GetScreenCoordinates(gfx::Point()); + gfx::Point guest_coordinates = gfx::Point(); // Adjust (x,y) position for offset from guest to embedder. new_params.x += guest_coordinates.x(); diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp index 8ac42cafdce..b74b8add7c4 100644 --- a/src/core/media_capture_devices_dispatcher.cpp +++ b/src/core/media_capture_devices_dispatcher.cpp @@ -61,6 +61,7 @@ #include "content/public/browser/render_process_host.h" #include "media/audio/audio_device_description.h" #include "media/audio/audio_manager_base.h" +#include "services/network/public/cpp/is_potentially_trustworthy.h" #include "third_party/blink/public/common/loader/network_utils.h" #include "ui/base/l10n/l10n_util.h" @@ -351,7 +352,7 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter if (flags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture)) { const bool screenCaptureEnabled = adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::ScreenCaptureEnabled); - const bool originIsSecure = blink::network_utils::IsOriginSecure(request.security_origin); + const bool originIsSecure = network::IsUrlPotentiallyTrustworthy(request.security_origin); if (!screenCaptureEnabled || !originIsSecure) { std::move(callback).Run(blink::MediaStreamDevices(), MediaStreamRequestResult::INVALID_STATE, std::unique_ptr()); return; diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp index 99a207c0e75..3301b70ee70 100644 --- a/src/core/net/system_network_context_manager.cpp +++ b/src/core/net/system_network_context_manager.cpp @@ -67,7 +67,7 @@ #include "content/public/browser/network_service_instance.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" -#include "content/public/common/service_names.mojom.h" +// #include "content/public/common/service_names.mojom.h" #include "content/public/common/user_agent.h" #include "mojo/public/cpp/bindings/associated_interface_ptr.h" #include "net/dns/public/util.h" diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp index 27e58d75f47..092695c5cee 100644 --- a/src/core/net/webui_controller_factory_qt.cpp +++ b/src/core/net/webui_controller_factory_qt.cpp @@ -187,10 +187,10 @@ bool WebUIControllerFactoryQt::UseWebUIForURL(content::BrowserContext *browser_c return GetWebUIType(browser_context, url) != WebUI::kNoWebUI; } -bool WebUIControllerFactoryQt::UseWebUIBindingsForURL(content::BrowserContext *browser_context, const GURL &url) -{ - return UseWebUIForURL(browser_context, url); -} +// bool WebUIControllerFactoryQt::UseWebUIBindingsForURL(content::BrowserContext *browser_context, const GURL &url) +// { +// return UseWebUIForURL(browser_context, url); +// } std::unique_ptr WebUIControllerFactoryQt::CreateWebUIControllerForURL(WebUI *web_ui, const GURL &url) { diff --git a/src/core/net/webui_controller_factory_qt.h b/src/core/net/webui_controller_factory_qt.h index 1cc76349b2e..e0392d76ec9 100644 --- a/src/core/net/webui_controller_factory_qt.h +++ b/src/core/net/webui_controller_factory_qt.h @@ -60,7 +60,7 @@ class WebUIControllerFactoryQt : public content::WebUIControllerFactory public: content::WebUI::TypeID GetWebUIType(content::BrowserContext *browserContext, const GURL &url) override; bool UseWebUIForURL(content::BrowserContext *browserContext, const GURL &url) override; - bool UseWebUIBindingsForURL(content::BrowserContext *browserContext, const GURL &url) override; + // bool UseWebUIBindingsForURL(content::BrowserContext *browserContext, const GURL &url) override; std::unique_ptr CreateWebUIControllerForURL(content::WebUI *webUi, const GURL &url) override; static WebUIControllerFactoryQt *GetInstance(); diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp index c79a7ae4544..a83143c2d4e 100644 --- a/src/core/permission_manager_qt.cpp +++ b/src/core/permission_manager_qt.cpp @@ -69,7 +69,7 @@ static ProfileAdapter::PermissionType toQt(content::PermissionType type) return ProfileAdapter::NotificationPermission; case content::PermissionType::ACCESSIBILITY_EVENTS: return ProfileAdapter::UnsupportedPermission; - case content::PermissionType::FLASH: + // case content::PermissionType::FLASH: case content::PermissionType::MIDI_SYSEX: case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: case content::PermissionType::MIDI: diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp index ff653c06620..d54ef6c46e2 100644 --- a/src/core/pref_service_adapter.cpp +++ b/src/core/pref_service_adapter.cpp @@ -115,7 +115,7 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter) registry->RegisterListPref(extensions::pref_names::kInstallAllowList); registry->RegisterListPref(extensions::pref_names::kInstallDenyList); registry->RegisterDictionaryPref(extensions::pref_names::kInstallForceList); - registry->RegisterDictionaryPref(extensions::pref_names::kLoginScreenExtensions); + // registry->RegisterDictionaryPref(extensions::pref_names::kLoginScreenExtensions); registry->RegisterListPref(extensions::pref_names::kAllowedTypes); registry->RegisterBooleanPref(extensions::pref_names::kStorageGarbageCollect, false); registry->RegisterListPref(extensions::pref_names::kAllowedInstallSites); diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp index ad35209f111..5d3993ddbfa 100644 --- a/src/core/printing/print_view_manager_base_qt.cpp +++ b/src/core/printing/print_view_manager_base_qt.cpp @@ -212,10 +212,10 @@ bool PrintViewManagerBaseQt::PrintJobHasDocument(int cookie) return document && document->cookie() == cookie; } -// IPC handlers -void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*render_frame_host*/, - const printing::mojom::DidPrintDocumentParams ¶ms, - std::unique_ptr helper) +#if FIX_PRINTING +IPC handlers +void PrintViewManagerBaseQt::OnDidPrintDocument(printing::mojom::DidPrintDocumentParamsPtr params, + DidPrintDocumentCallback callback) { if (!PrintJobHasDocument(params.document_cookie)) return; @@ -236,9 +236,10 @@ void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*rend PrintDocument(data, params.page_size, params.content_area, params.physical_offsets); - if (helper) - helper->SendCompleted(); + + std::move(callback).Run(false); } +#endif // FIX_PRINTING void PrintViewManagerBaseQt::GetDefaultPrintSettings(GetDefaultPrintSettingsCallback callback) { @@ -264,12 +265,14 @@ void PrintViewManagerBaseQt::PrintingFailed(int32_t cookie) content::NotificationService::NoDetails()); } +#if FIX_PRINTING void PrintViewManagerBaseQt::OnScriptedPrint(content::RenderFrameHost *render_frame_host, const printing::mojom::ScriptedPrintParams ¶ms, IPC::Message *reply_msg) { NOTREACHED() << "should be handled by printing::PrintingMessageFilter"; } +#endif // FIX_PRINTING void PrintViewManagerBaseQt::ShowInvalidPrinterSettingsError() { diff --git a/src/core/printing/print_view_manager_base_qt.h b/src/core/printing/print_view_manager_base_qt.h index 3086d5d3a4d..9b50484f29c 100644 --- a/src/core/printing/print_view_manager_base_qt.h +++ b/src/core/printing/print_view_manager_base_qt.h @@ -118,13 +118,14 @@ class PrintViewManagerBaseQt : public content::NotificationObserver void DidStartLoading() override; // printing::PrintManager: +#if FIX_PRINTING void OnDidPrintDocument( - content::RenderFrameHost *render_frame_host, - const printing::mojom::DidPrintDocumentParams ¶ms, - std::unique_ptr helper) override; + printing::mojom::DidPrintDocumentParamsPtr params, + DidPrintDocumentCallback callback) override; void OnScriptedPrint(content::RenderFrameHost *render_frame_host, const printing::mojom::ScriptedPrintParams ¶ms, IPC::Message *reply_msg) override; +#endif // Processes a NOTIFY_PRINT_JOB_EVENT notification. void OnNotifyPrintJobEvent(const printing::JobEventDetails &event_details); diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp index de1b81fb9f5..26a2632ba0d 100644 --- a/src/core/printing/print_view_manager_qt.cpp +++ b/src/core/printing/print_view_manager_qt.cpp @@ -288,20 +288,24 @@ PrintViewManagerQt::PrintViewManagerQt(content::WebContents *contents) bool PrintViewManagerQt::OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host) { +#if FIX_PRINTING FrameDispatchHelper helper = {this, render_frame_host}; bool handled = true; IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(PrintViewManagerQt, message, render_frame_host); - IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, OnRequestPrintPreview) + // IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, OnRequestPrintPreview) IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting, OnMetafileReadyForPrinting); IPC_MESSAGE_HANDLER(PrintHostMsg_DidPreviewPage, OnDidPreviewPage) IPC_MESSAGE_FORWARD_DELAY_REPLY( PrintHostMsg_SetupScriptedPrintPreview, &helper, FrameDispatchHelper::OnSetupScriptedPrintPreview) - IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, - OnShowScriptedPrintPreview) + // IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, + // OnShowScriptedPrintPreview) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled || PrintViewManagerBaseQt::OnMessageReceived(message, render_frame_host); +#else + return false; +#endif // FIX_PRINTING } void PrintViewManagerQt::RenderFrameDeleted(content::RenderFrameHost *render_frame_host) @@ -339,6 +343,7 @@ void PrintViewManagerQt::resetPdfState() // IPC handlers +#if FIX_PRINTING void PrintViewManagerQt::OnRequestPrintPreview( const PrintHostMsg_RequestPrintPreview_Params & /*params*/) { @@ -347,6 +352,7 @@ void PrintViewManagerQt::OnRequestPrintPreview( printRenderFrame->PrintPreview(m_printSettings->Clone()); PrintPreviewDone(); } +#endif // FIX_PRINTING void PrintViewManagerQt::OnMetafileReadyForPrinting(content::RenderFrameHost* rfh, const printing::mojom::DidPreviewDocumentParams& params, @@ -424,11 +430,13 @@ void PrintViewManagerQt::OnSetupScriptedPrintPreview(content::RenderFrameHost* r client->printRequested(); } +#if FIX_PRINTING void PrintViewManagerQt::OnShowScriptedPrintPreview(content::RenderFrameHost* rfh, bool source_is_modifiable) { // ignore for now } +#endif void PrintViewManagerQt::PrintPreviewDone() { GetPrintRenderFrame(m_printPreviewRfh)->OnPrintPreviewDialogClosed(); diff --git a/src/core/printing/print_view_manager_qt.h b/src/core/printing/print_view_manager_qt.h index ecb3d6053ba..96cb7b060ec 100644 --- a/src/core/printing/print_view_manager_qt.h +++ b/src/core/printing/print_view_manager_qt.h @@ -99,7 +99,9 @@ class PrintViewManagerQt void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; // IPC handlers +#if FIX_PRINTING void OnRequestPrintPreview(const PrintHostMsg_RequestPrintPreview_Params&); +#endif void OnMetafileReadyForPrinting(content::RenderFrameHost* rfh, const printing::mojom::DidPreviewDocumentParams& params, const printing::mojom::PreviewIds &ids); @@ -108,9 +110,12 @@ class PrintViewManagerQt void OnDidPreviewPage(content::RenderFrameHost* rfh, const printing::mojom::DidPreviewPageParams& params, const printing::mojom::PreviewIds& ids); +#if FIX_PRINTING void OnShowScriptedPrintPreview(content::RenderFrameHost* rfh, bool source_is_modifiable); +#endif bool PrintToPDFInternal(const QPageLayout &, bool printInColor, bool useCustomMargins = true); + void ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr params, ScriptedPrintCallback callback) override {} private: void resetPdfState(); diff --git a/src/core/printing/printing_message_filter_qt.cpp b/src/core/printing/printing_message_filter_qt.cpp index 9e0b3be153f..aebb40681dc 100644 --- a/src/core/printing/printing_message_filter_qt.cpp +++ b/src/core/printing/printing_message_filter_qt.cpp @@ -72,6 +72,7 @@ void PrintingMessageFilterQt::OnDestruct() const } bool PrintingMessageFilterQt::OnMessageReceived(const IPC::Message& message) { +#if FIX_PRINTING bool handled = true; IPC_BEGIN_MESSAGE_MAP(PrintingMessageFilterQt, message) IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_ScriptedPrint, OnScriptedPrint) @@ -79,6 +80,9 @@ bool PrintingMessageFilterQt::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; +#else + return false; +#endif } void PrintingMessageFilterQt::OnScriptedPrint( @@ -106,6 +110,7 @@ void PrintingMessageFilterQt::OnScriptedPrint( void PrintingMessageFilterQt::OnScriptedPrintReply( std::unique_ptr printer_query, IPC::Message* reply_msg) { +#if FIX_PRINTING printing::mojom::PrintPagesParams params; params.params = printing::mojom::PrintParams::New(); if (printer_query->last_status() != printing::PrintingContext::OK || @@ -123,6 +128,7 @@ void PrintingMessageFilterQt::OnScriptedPrintReply( } else { printer_query->StopWorker(); } +#endif } void PrintingMessageFilterQt::OnCheckForCancel(const printing::mojom::PreviewIds& ids, diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index b2c8573e3c5..c8442e5d04e 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -413,9 +413,9 @@ void RenderWidgetHostViewQt::InitAsPopup(content::RenderWidgetHostView*, const g m_delegate->initAsPopup(toQt(rect)); } -void RenderWidgetHostViewQt::InitAsFullscreen(content::RenderWidgetHostView*) -{ -} +// void RenderWidgetHostViewQt::InitAsFullscreen(content::RenderWidgetHostView*) +// { +// } void RenderWidgetHostViewQt::SetSize(const gfx::Size &sizeInDips) { @@ -445,18 +445,18 @@ gfx::NativeViewAccessible RenderWidgetHostViewQt::GetNativeViewAccessible() return 0; } -content::BrowserAccessibilityManager* RenderWidgetHostViewQt::CreateBrowserAccessibilityManager(content::BrowserAccessibilityDelegate* delegate, bool for_root_frame) -{ - Q_UNUSED(for_root_frame); // FIXME -#if QT_CONFIG(accessibility) - return new content::BrowserAccessibilityManagerQt( - m_adapterClient->accessibilityParentObject(), - content::BrowserAccessibilityManagerQt::GetEmptyDocument(), - delegate); -#else - return 0; -#endif // QT_CONFIG(accessibility) -} +// content::BrowserAccessibilityManager* RenderWidgetHostViewQt::CreateBrowserAccessibilityManager(content::BrowserAccessibilityDelegate* delegate, bool for_root_frame) +// { +// Q_UNUSED(for_root_frame); // FIXME +// #if QT_CONFIG(accessibility) +// return new content::BrowserAccessibilityManagerQt( +// m_adapterClient->accessibilityParentObject(), +// content::BrowserAccessibilityManagerQt::GetEmptyDocument(), +// delegate); +// #else +// return 0; +// #endif // QT_CONFIG(accessibility) +// } // Set focus to the associated View component. void RenderWidgetHostViewQt::Focus() diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index 4ca1d0bd799..d9b77a453c2 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -122,7 +122,7 @@ class RenderWidgetHostViewQt void InitAsChild(gfx::NativeView) override; void InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect&) override; - void InitAsFullscreen(content::RenderWidgetHostView*) override; + // void InitAsFullscreen(content::RenderWidgetHostView*) override; void SetSize(const gfx::Size& size) override; void SetBounds(const gfx::Rect&) override; gfx::NativeView GetNativeView() override; @@ -219,7 +219,7 @@ class RenderWidgetHostViewQt #endif // defined(OS_MAC) // Overridden from content::BrowserAccessibilityDelegate - content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager(content::BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; + // content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager(content::BrowserAccessibilityDelegate* delegate, bool for_root_frame) override; // Called from WebContentsDelegateQt void OnDidFirstVisuallyNonEmptyPaint(); diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp index 61b8b5a405c..ac40fef7572 100644 --- a/src/core/renderer/content_renderer_client_qt.cpp +++ b/src/core/renderer/content_renderer_client_qt.cpp @@ -588,12 +588,11 @@ void ContentRendererClientQt::WillSendRequest(blink::WebLocalFrame *frame, const blink::WebURL &url, const net::SiteForCookies &site_for_cookies, const url::Origin *initiator_origin, - GURL *new_url, - bool *attach_same_site_cookies) + GURL *new_url) { #if BUILDFLAG(ENABLE_EXTENSIONS) - ExtensionsRendererClientQt::GetInstance()->WillSendRequest(frame, transition_type, url, /*site_for_cookies,*/ - initiator_origin, new_url, attach_same_site_cookies); + ExtensionsRendererClientQt::GetInstance()->WillSendRequest(frame, transition_type, url, + initiator_origin, new_url); if (!new_url->is_empty()) return; #endif diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h index dfe3ca03568..9c8e7be8249 100644 --- a/src/core/renderer/content_renderer_client_qt.h +++ b/src/core/renderer/content_renderer_client_qt.h @@ -123,8 +123,7 @@ class ContentRendererClientQt const blink::WebURL &url, const net::SiteForCookies &site_for_cookies, const url::Origin *initiator_origin, - GURL *new_url, - bool *attach_same_site_cookies) override; + GURL *new_url) override; bool RequiresHtmlImports(const GURL &url) override; diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp index 3d1a8685c23..cbdc63aa9f7 100644 --- a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp +++ b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp @@ -127,8 +127,8 @@ bool ExtensionsRendererClientQt::ExtensionAPIEnabledForServiceWorkerScript(const if (!script_url.SchemeIs(extensions::kExtensionScheme)) return false; - if (!extensions::ExtensionsClient::Get()->ExtensionAPIEnabledInExtensionServiceWorkers()) - return false; + // if (!extensions::ExtensionsClient::Get()->ExtensionAPIEnabledInExtensionServiceWorkers()) + // return false; const extensions::Extension* extension = extensions::RendererExtensionRegistry::Get()->GetExtensionOrAppByURL(script_url); @@ -186,7 +186,7 @@ void ExtensionsRendererClientQt::WillSendRequest(blink::WebLocalFrame *frame, bool *attach_same_site_cookies) { if (url.ProtocolIs(extensions::kExtensionScheme) && - !resource_request_policy_->CanRequestResource(url, frame, transition_type)) { + !resource_request_policy_->CanRequestResource(url, frame, transition_type, base::OptionalFromPtr(initiator_origin))) { *new_url = GURL(chrome::kExtensionInvalidRequestURL); } } diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.h b/src/core/renderer/extensions/extensions_renderer_client_qt.h index 85cc7bf2d62..fe3bab0ff91 100644 --- a/src/core/renderer/extensions/extensions_renderer_client_qt.h +++ b/src/core/renderer/extensions/extensions_renderer_client_qt.h @@ -101,7 +101,7 @@ class ExtensionsRendererClientQt : public extensions::ExtensionsRendererClient const blink::WebURL &url, const url::Origin *initiator_origin, GURL *new_url, - bool *attach_same_site_cookies); + bool *attach_same_site_cookies = nullptr); static bool ShouldFork(blink::WebLocalFrame *frame, const GURL &url, diff --git a/src/core/renderer/extensions/resource_request_policy_qt.cpp b/src/core/renderer/extensions/resource_request_policy_qt.cpp index efe44521daf..70e97819c90 100644 --- a/src/core/renderer/extensions/resource_request_policy_qt.cpp +++ b/src/core/renderer/extensions/resource_request_policy_qt.cpp @@ -85,7 +85,8 @@ void ResourceRequestPolicyQt::OnExtensionUnloaded(const ExtensionId &extension_i // than those triggered through UI. bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url, blink::WebLocalFrame *frame, - ui::PageTransition transition_type) + ui::PageTransition transition_type, + const base::Optional& initiator_origin) { CHECK(resource_url.SchemeIs(kExtensionScheme)); @@ -165,7 +166,7 @@ bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url, // Disallow loading of extension resources which are not explicitly listed // as web or WebView accessible if the manifest version is 2 or greater. - if (!WebAccessibleResourcesInfo::IsResourceWebAccessible(extension, resource_url.path()) && + if (!WebAccessibleResourcesInfo::IsResourceWebAccessible(extension, resource_url.path(), initiator_origin) && !WebviewInfo::IsResourceWebviewAccessible(extension, m_dispatcher->webview_partition_id(), resource_url.path())) { std::string message = base::StringPrintf( diff --git a/src/core/renderer/extensions/resource_request_policy_qt.h b/src/core/renderer/extensions/resource_request_policy_qt.h index e6d4e79bb78..e0238c2e4af 100644 --- a/src/core/renderer/extensions/resource_request_policy_qt.h +++ b/src/core/renderer/extensions/resource_request_policy_qt.h @@ -43,8 +43,10 @@ #include #include "base/macros.h" +#include "base/optional.h" #include "extensions/common/extension_id.h" #include "ui/base/page_transition_types.h" +#include "url/origin.h" class GURL; @@ -73,7 +75,8 @@ class ResourceRequestPolicyQt // than those triggered through UI. bool CanRequestResource(const GURL &resource_url, blink::WebLocalFrame *frame, - ui::PageTransition transition_type); + ui::PageTransition transition_type, + const base::Optional& initiator_origin); private: Dispatcher *m_dispatcher; diff --git a/src/core/touch_selection_controller_client_qt.cpp b/src/core/touch_selection_controller_client_qt.cpp index ef7b22ecc8b..2e9f56a5fce 100644 --- a/src/core/touch_selection_controller_client_qt.cpp +++ b/src/core/touch_selection_controller_client_qt.cpp @@ -285,8 +285,9 @@ void TouchSelectionControllerClientQt::OnSelectionEvent(ui::SelectionEventType e updateMenu(); } -void TouchSelectionControllerClientQt::OnDragUpdate(const gfx::PointF& position) +void TouchSelectionControllerClientQt::OnDragUpdate(const ui::TouchSelectionDraggable::Type type, const gfx::PointF& position) { + Q_UNUSED(type); Q_UNUSED(position); } diff --git a/src/core/touch_selection_controller_client_qt.h b/src/core/touch_selection_controller_client_qt.h index aadf7217232..02febd9bfdb 100644 --- a/src/core/touch_selection_controller_client_qt.h +++ b/src/core/touch_selection_controller_client_qt.h @@ -94,7 +94,7 @@ class TouchSelectionControllerClientQt void MoveRangeSelectionExtent(const gfx::PointF& extent) override; void SelectBetweenCoordinates(const gfx::PointF& base, const gfx::PointF& extent) override; void OnSelectionEvent(ui::SelectionEventType event) override; - void OnDragUpdate(const gfx::PointF& position) override; + void OnDragUpdate(const ui::TouchSelectionDraggable::Type type, const gfx::PointF& position) override; std::unique_ptr CreateDrawable() override; void DidScroll() override; diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h index 1152ed9a9b7..3388fded381 100644 --- a/src/core/type_conversion.h +++ b/src/core/type_conversion.h @@ -117,7 +117,7 @@ inline base::string16 toString16(const QString &qString) #if defined(OS_WIN) return base::string16(qString.toStdWString()); #else - return base::string16(qString.utf16()); + return base::string16(qString.toStdU16String()); #endif } diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index a1d6ec0f451..379c9994e66 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -95,6 +95,7 @@ #include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/clipboard_constants.h" #include "ui/base/clipboard/custom_data_helper.h" +#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h" #include "ui/gfx/font_render_params.h" #include "qtwebengine/browser/qtwebenginepage.mojom.h" @@ -426,7 +427,7 @@ QSharedPointer WebContentsAdapter::createFromSerializedNavig // Unlike WebCore, Chromium only supports Restoring to a new WebContents instance. std::unique_ptr newWebContents = createBlankWebContents(adapterClient, adapterClient->profileAdapter()->profile()); content::NavigationController &controller = newWebContents->GetController(); - controller.Restore(currentIndex, content::RestoreType::LAST_SESSION_EXITED_CLEANLY, &entries); + controller.Restore(currentIndex, content::RestoreType::kRestored, &entries); if (controller.GetActiveEntry()) { // Set up the file access rights for the selected navigation entry. @@ -1531,7 +1532,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD if (rvh) { rvh->GetWidget()->DragSourceEndedAt(gfx::PointF(m_lastDragClientPos.x(), m_lastDragClientPos.y()), gfx::PointF(m_lastDragScreenPos.x(), m_lastDragScreenPos.y()), - blink::DragOperation(m_currentDropAction)); + ui::mojom::DragOperation(m_currentDropAction)); rvh->GetWidget()->DragSourceSystemDragEnded(); } } @@ -1592,13 +1593,14 @@ static void fillDropDataFromMimeData(content::DropData *dropData, const QMimeDat } } -Qt::DropAction toQt(blink::DragOperation op) +Qt::DropAction toQt(ui::mojom::DragOperation drag_operation) { + blink::DragOperationsMask op = blink::DragOperationsMask(int(drag_operation)); if (op & blink::kDragOperationCopy) return Qt::CopyAction; if (op & blink::kDragOperationLink) return Qt::LinkAction; - if (op & blink::kDragOperationMove || op & blink::kDragOperationDelete) + if (op & blink::kDragOperationMove) return Qt::MoveAction; return Qt::IgnoreAction; } @@ -1655,7 +1657,7 @@ Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const Q rvh->GetWidget()->DragTargetDragOver(toGfx(m_lastDragClientPos), toGfx(m_lastDragScreenPos), toWeb(e->possibleActions()), toWeb(e->mouseButtons()) | toWeb(e->keyboardModifiers())); waitForUpdateDragActionCalled(); - return toQt(blink::DragOperation(m_currentDropAction)); + return toQt(ui::mojom::DragOperation(m_currentDropAction)); } void WebContentsAdapter::waitForUpdateDragActionCalled() @@ -1688,7 +1690,7 @@ void WebContentsAdapter::updateDragAction(int action) { CHECK_INITIALIZED(); m_updateDragActionCalled = true; - m_currentDropAction = static_cast(action); + m_currentDropAction = action; } void WebContentsAdapter::endDragging(QDropEvent *e, const QPointF &screenPos) diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index caf74ace38b..9fcdad25c8a 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -60,7 +60,6 @@ #include "content/public/browser/context_menu_params.h" #include "content/public/browser/web_contents_delegate.h" #include "third_party/blink/public/common/context_menu_data/edit_flags.h" -#include "third_party/blink/public/common/context_menu_data/media_type.h" #include "ui/gfx/image/image_skia.h" #include @@ -164,13 +163,13 @@ void WebContentsViewQt::FocusThroughTabTraversal(bool reverse) } -ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeNone, blink::ContextMenuDataMediaType::kNone) -ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeImage, blink::ContextMenuDataMediaType::kImage) -ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeVideo, blink::ContextMenuDataMediaType::kVideo) -ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeAudio, blink::ContextMenuDataMediaType::kAudio) -ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeCanvas, blink::ContextMenuDataMediaType::kCanvas) -ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeFile, blink::ContextMenuDataMediaType::kFile) -ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypePlugin, blink::ContextMenuDataMediaType::kPlugin) +ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeNone, blink::mojom::ContextMenuDataMediaType::kNone) +ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeImage, blink::mojom::ContextMenuDataMediaType::kImage) +ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeVideo, blink::mojom::ContextMenuDataMediaType::kVideo) +ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeAudio, blink::mojom::ContextMenuDataMediaType::kAudio) +ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeCanvas, blink::mojom::ContextMenuDataMediaType::kCanvas) +ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypeFile, blink::mojom::ContextMenuDataMediaType::kFile) +ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaTypePlugin, blink::mojom::ContextMenuDataMediaType::kPlugin) ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaNone, blink::WebContextMenuData::kMediaNone) ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaInError, blink::WebContextMenuData::kMediaInError) @@ -250,7 +249,7 @@ static Qt::DropActions toQtDropActions(blink::DragOperationsMask ops) result |= Qt::CopyAction; if (ops & blink::kDragOperationLink) result |= Qt::LinkAction; - if (ops & blink::kDragOperationMove || ops & blink::kDragOperationDelete) + if (ops & blink::kDragOperationMove) result |= Qt::MoveAction; return result; } @@ -283,10 +282,10 @@ void WebContentsViewQt::StartDragging(const content::DropData &drop_data, #endif // QT_CONFIG(draganddrop) } -void WebContentsViewQt::UpdateDragCursor(blink::DragOperation dragOperation) +void WebContentsViewQt::UpdateDragCursor(ui::mojom::DragOperation dragOperation) { #if QT_CONFIG(draganddrop) - m_client->webContentsAdapter()->updateDragAction(dragOperation); + m_client->webContentsAdapter()->updateDragAction(static_cast(dragOperation)); #endif // QT_CONFIG(draganddrop) } diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h index d2f82dfadf3..8dc7d038177 100644 --- a/src/core/web_contents_view_qt.h +++ b/src/core/web_contents_view_qt.h @@ -112,7 +112,7 @@ class WebContentsViewQt const blink::mojom::DragEventSourceInfo &event_info, content::RenderWidgetHostImpl *source_rwh) override; - void UpdateDragCursor(blink::DragOperation dragOperation) override; + void UpdateDragCursor(ui::mojom::DragOperation dragOperation) override; void ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams ¶ms) override; diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 65eb6f022d0..60fa5df23d9 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -63,7 +63,7 @@ #include "components/discardable_memory/service/discardable_shared_memory_manager.h" #include "components/viz/common/features.h" #include "components/web_cache/browser/web_cache_manager.h" -#include "content/app/service_manager_environment.h" +#include "content/app/mojo_ipc_support.h" #include "content/browser/devtools/devtools_http_handler.h" #include "content/browser/scheduler/browser_task_executor.h" #include "content/browser/startup_data_impl.h" @@ -404,7 +404,7 @@ void WebEngineContext::destroy() // These would normally be in the content-runner, but we allocated them separately: m_startupData.reset(); - m_serviceManagerEnvironment.reset(); + m_mojo_ipc_support.reset(); m_discardableSharedMemoryManager.reset(); // Destroying content-runner will force Chromium at_exit calls to run, and @@ -748,7 +748,7 @@ WebEngineContext::WebEngineContext() parsedCommandLine->AppendSwitch(switches::kInProcessGPU); if (enableGLSoftwareRendering) { parsedCommandLine->AppendSwitch(switches::kDisableGpuRasterization); - parsedCommandLine->AppendSwitch(switches::kIgnoreGpuBlacklist); + parsedCommandLine->AppendSwitch(switches::kIgnoreGpuBlocklist); } } else { parsedCommandLine->AppendSwitch(switches::kDisableGpu); @@ -781,8 +781,8 @@ WebEngineContext::WebEngineContext() tracing::InitTracingPostThreadPoolStartAndFeatureList(); m_discardableSharedMemoryManager = std::make_unique(); base::PowerMonitor::Initialize(std::make_unique()); - m_serviceManagerEnvironment = std::make_unique(content::BrowserTaskExecutor::CreateIOThread()); - m_startupData = m_serviceManagerEnvironment->CreateBrowserStartupData(); + m_mojo_ipc_support = std::make_unique(content::BrowserTaskExecutor::CreateIOThread()); + m_startupData = m_mojo_ipc_support->CreateBrowserStartupData(); // Once the MessageLoop has been created, attach a top-level RunLoop. m_runLoop.reset(new base::RunLoop); diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h index e2190f8a2d1..62f61a8fc4a 100644 --- a/src/core/web_engine_context.h +++ b/src/core/web_engine_context.h @@ -60,7 +60,7 @@ class ContentMainRunner; class GpuProcess; class GpuThreadController; class InProcessChildThreadParams; -class ServiceManagerEnvironment; +class MojoIpcSupport; struct StartupData; } @@ -140,7 +140,7 @@ class WebEngineContext : public base::RefCounted { std::unique_ptr m_browserRunner; std::unique_ptr m_discardableSharedMemoryManager; std::unique_ptr m_startupData; - std::unique_ptr m_serviceManagerEnvironment; + std::unique_ptr m_mojo_ipc_support; std::unique_ptr m_globalQObject; std::unique_ptr m_defaultProfileAdapter; std::unique_ptr m_devtoolsServer; diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index 1a9a6deea14..5548a07805d 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -53,6 +53,8 @@ #include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h" #include "third_party/blink/public/common/web_preferences/web_preferences.h" #include "third_party/blink/public/mojom/renderer_preferences.mojom.h" +#include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom-blink.h" +#include "ui/base/pointer/pointer_device.h" #include "ui/base/ui_base_switches.h" #include "ui/events/event_switches.h" #include "ui/native_theme/native_theme.h" @@ -353,7 +355,7 @@ void WebEngineSettings::applySettingsToWebPreferences(blink::web_pref::WebPrefer prefs->touch_event_feature_detection_enabled = isTouchEventsAPIEnabled(); #if !QT_CONFIG(webengine_embedded_build) prefs->available_hover_types = ui::HOVER_TYPE_HOVER; - prefs->primary_hover_type = ui::HOVER_TYPE_HOVER; + prefs->primary_hover_type = blink::mojom::HoverType::kHoverNone; #endif if (prefs->viewport_enabled) { // We need to enable the viewport options together as it doesn't really work diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp index 0c235382a48..5cd6cef40c7 100644 --- a/tests/auto/widgets/accessibility/tst_accessibility.cpp +++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp @@ -493,7 +493,6 @@ void tst_Accessibility::roles_data() QTest::newRow("ax::mojom::Role::kSearchBox") << QString("") << 1 << QAccessible::EditableText; QTest::newRow("ax::mojom::Role::kSection") << QString("
") << 0 << QAccessible::Section; QTest::newRow("ax::mojom::Role::kSlider") << QString("") << 1 << QAccessible::Slider; - //QTest::newRow("ax::mojom::Role::kSliderThumb") << QString("") << 1 << QAccessible::Slider; // TODO: blink/renderer/modules/accessibility/ax_slider.cc QTest::newRow("ax::mojom::Role::kSpinButton") << QString("") << 1 << QAccessible::SpinBox; QTest::newRow("ax::mojom::Role::kSplitter") << QString("
") << 0 << QAccessible::Splitter; QTest::newRow("ax::mojom::Role::kStaticText") << QString("a") << 1 << QAccessible::StaticText;