diff options
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 16945020b..5816749c8 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -87,7 +87,7 @@ #include "services/service_manager/public/cpp/service.h" #include "services/service_manager/sandbox/switches.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" -#include "third_party/blink/public/platform/modules/insecure_input/insecure_input_service.mojom.h" +#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" #include "ui/gl/gl_context.h" @@ -195,8 +195,14 @@ public: } void* GetHandle() override { return m_handle; } - // Qt currently never creates contexts using robustness attributes. - bool WasAllocatedUsingRobustnessExtension() override { return false; } + bool WasAllocatedUsingRobustnessExtension() override + { +#if QT_CONFIG(opengl) + if (QOpenGLContext *context = qt_gl_global_share_context()) + return context->format().testOption(QSurfaceFormat::ResetNotification); +#endif + return false; + } // We don't care about the rest, this context shouldn't be used except for its handle. bool Initialize(gl::GLSurface *, const gl::GLContextAttribs &) override { Q_UNREACHABLE(); return false; } @@ -331,7 +337,7 @@ void ContentBrowserClientQt::OverrideWebkitPrefs(content::RenderViewHost *rvh, c } } -content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionContext() +scoped_refptr<content::QuotaPermissionContext> ContentBrowserClientQt::CreateQuotaPermissionContext() { return new QuotaPermissionContextQt; } @@ -340,7 +346,7 @@ void ContentBrowserClientQt::GetQuotaSettings(content::BrowserContext* context, content::StoragePartition* partition, storage::OptionalQuotaSettingsCallback callback) { - storage::GetNominalDynamicSettings(partition->GetPath(), context->IsOffTheRecord(), std::move(callback)); + storage::GetNominalDynamicSettings(partition->GetPath(), context->IsOffTheRecord(), storage::GetDefaultDiskInfoHelper(), std::move(callback)); } // Copied from chrome/browser/ssl/ssl_error_handler.cc: @@ -478,11 +484,12 @@ content::DevToolsManagerDelegate* ContentBrowserClientQt::GetDevToolsManagerDele return new DevToolsManagerDelegateQt; } -content::PlatformNotificationService *ContentBrowserClientQt::GetPlatformNotificationService() +content::PlatformNotificationService *ContentBrowserClientQt::GetPlatformNotificationService(content::BrowserContext *browser_context) { - if (!m_platformNotificationService) - m_platformNotificationService = std::make_unique<PlatformNotificationServiceQt>(); - return m_platformNotificationService.get(); + ProfileQt *profile = static_cast<ProfileQt *>(browser_context); + if (!profile) + return nullptr; + return profile->platformNotificationService(); } // This is a really complicated way of doing absolutely nothing, but Mojo demands it: @@ -524,7 +531,7 @@ public: { } private: - WEB_CONTENTS_USER_DATA_KEY_DECL() + WEB_CONTENTS_USER_DATA_KEY_DECL(); explicit ServiceDriver(content::WebContents* /*web_contents*/) { } friend class content::WebContentsUserData<ServiceDriver>; mojo::BindingSet<blink::mojom::InsecureInputService> m_insecureInputServiceBindings; @@ -536,7 +543,7 @@ void ContentBrowserClientQt::InitFrameInterfaces() { m_frameInterfaces = std::make_unique<service_manager::BinderRegistry>(); m_frameInterfacesParameterized = std::make_unique<service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>>(); - m_frameInterfacesParameterized->AddInterface(base::Bind(&ServiceDriver::BindInsecureInputService)); + m_frameInterfacesParameterized->AddInterface(base::BindRepeating(&ServiceDriver::BindInsecureInputService)); } void ContentBrowserClientQt::BindInterfaceRequestFromFrame(content::RenderFrameHost* render_frame_host, @@ -741,7 +748,9 @@ bool ContentBrowserClientQt::HandleExternalProtocol( ui::PageTransition page_transition, bool has_user_gesture, const std::string &method, - const net::HttpRequestHeaders &headers) + const net::HttpRequestHeaders &headers, + network::mojom::URLLoaderFactoryRequest *factory_request, + network::mojom::URLLoaderFactory *&out_factory) { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); Q_UNUSED(child_id); @@ -759,18 +768,17 @@ bool ContentBrowserClientQt::HandleExternalProtocol( return true; } -scoped_refptr<content::LoginDelegate> ContentBrowserClientQt::CreateLoginDelegate( - net::AuthChallengeInfo *authInfo, - content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - const content::GlobalRequestID &request_id, +std::unique_ptr<content::LoginDelegate> ContentBrowserClientQt::CreateLoginDelegate( + const net::AuthChallengeInfo &authInfo, + content::WebContents *web_contents, + const content::GlobalRequestID & /*request_id*/, bool /*is_main_frame*/, const GURL &url, - scoped_refptr<net::HttpResponseHeaders> response_headers, + scoped_refptr<net::HttpResponseHeaders> /*response_headers*/, bool first_auth_attempt, LoginAuthRequiredCallback auth_required_callback) { - auto loginDelegate = base::MakeRefCounted<LoginDelegateQt>(authInfo, web_contents_getter, url, first_auth_attempt, std::move(auth_required_callback)); - loginDelegate->triggerDialog(); + auto loginDelegate = std::make_unique<LoginDelegateQt>(authInfo, web_contents, url, first_auth_attempt, std::move(auth_required_callback)); return loginDelegate; } |