diff options
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 22 | ||||
-rw-r--r-- | src/core/content_browser_client_qt.h | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 60d7e3fdf..30ec43ca0 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -53,6 +53,7 @@ #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/common/url_schemes.h" #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/client_certificate_delegate.h" #include "content/public/browser/media_observer.h" @@ -92,6 +93,7 @@ #include "certificate_error_controller_p.h" #include "desktop_screen_qt.h" #include "devtools_manager_delegate_qt.h" +#include "location_provider_qt.h" #include "media_capture_devices_dispatcher.h" #include "net/network_delegate_qt.h" #include "net/qrc_protocol_handler_qt.h" @@ -733,6 +735,26 @@ bool ContentBrowserClientQt::CanCreateWindow( return (settings && settings->getJavaScriptCanOpenWindowsAutomatically()) || user_gesture; } +std::unique_ptr<device::LocationProvider> ContentBrowserClientQt::OverrideSystemLocationProvider() +{ + return base::WrapUnique(new LocationProviderQt()); +} + +scoped_refptr<net::URLRequestContextGetter> GetSystemRequestContextOnUIThread() +{ + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + return scoped_refptr<net::URLRequestContextGetter>( + BrowserContextAdapter::defaultContext()->browserContext()->GetRequestContext()); +} + +void ContentBrowserClientQt::GetGeolocationRequestContext( + base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)> callback) +{ + content::BrowserThread::PostTaskAndReplyWithResult( + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(&GetSystemRequestContextOnUIThread), std::move(callback)); +} + bool ContentBrowserClientQt::AllowGetCookie(const GURL &url, const GURL &first_party, const net::CookieList & /*cookie_list*/, diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index 5ef2cddfb..d803c856e 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -169,6 +169,8 @@ public: content::ResourceContext *context, const std::vector<std::pair<int, int> > &render_frames) override; + std::unique_ptr<device::LocationProvider> OverrideSystemLocationProvider() override; + void GetGeolocationRequestContext(base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)> callback) override; #if defined(Q_OS_LINUX) void GetAdditionalMappedFilesForChildProcess(const base::CommandLine& command_line, int child_process_id, content::PosixFileDescriptorInfo* mappings) override; #endif |