diff options
Diffstat (limited to 'src/core/browser_main_parts_qt.cpp')
-rw-r--r-- | src/core/browser_main_parts_qt.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp index 46d472abb..6facacc00 100644 --- a/src/core/browser_main_parts_qt.cpp +++ b/src/core/browser_main_parts_qt.cpp @@ -81,6 +81,7 @@ #if defined(OS_MAC) #include "base/message_loop/message_pump_mac.h" +#include "services/device/public/cpp/geolocation/geolocation_system_permission_mac.h" #include "ui/base/idle/idle.h" #endif @@ -219,6 +220,21 @@ private: QWebEngineMessagePumpScheduler m_scheduler; }; +#if defined(OS_MAC) +class FakeSystemGeolocationPermissionManager : public device::GeolocationSystemPermissionManager +{ +public: + FakeSystemGeolocationPermissionManager() = default; + ~FakeSystemGeolocationPermissionManager() override = default; + + // GeolocationSystemPermissionManager implementation: + device::LocationSystemPermissionStatus GetSystemPermission() override + { + return device::LocationSystemPermissionStatus::kDenied; + } +}; +#endif // defined(OS_MAC) + std::unique_ptr<base::MessagePump> messagePumpFactory() { static bool madePrimaryPump = false; @@ -243,6 +259,9 @@ int BrowserMainPartsQt::PreEarlyInitialization() void BrowserMainPartsQt::PreMainMessageLoopStart() { +#if defined(OS_MAC) + m_locationPermissionManager = std::make_unique<FakeSystemGeolocationPermissionManager>(); +#endif } void BrowserMainPartsQt::PreMainMessageLoopRun() @@ -300,4 +319,11 @@ void BrowserMainPartsQt::PostCreateThreads() performance_manager_registry_ = performance_manager::PerformanceManagerRegistry::Create(); } +#if defined(OS_MAC) +device::GeolocationSystemPermissionManager *BrowserMainPartsQt::GetLocationPermissionManager() +{ + return m_locationPermissionManager.get(); +} +#endif + } // namespace QtWebEngineCore |