mirror of
				https://github.com/mozilla/gecko-dev.git
				synced 2025-10-31 08:18:54 +02:00 
			
		
		
		
	 48c6934e1d
			
		
	
	
		48c6934e1d
		
	
	
	
	
		
			
			When Windows presents the dialog asking the user to give geolocation permission to Firefox, we need to wait for the user to make a choice before running the geolocation request. Previously, we were not waiting for the user's response so most requests would timeout and fail, even if the user replied "Yes". This dialog is only ever presented once -- the first time that Firefox asks Windows for a wifi scan. It does not reappear on restarts or reinstalls. This dedicated Yes/No system prompt is a bit more user-friendly than system settings. This "system will prompt for permission" case could be completely avoided since wifi scanning is not useful to us when it requires geolocation permissions as geolocation would override it. We would need the MLSFallback behavior to skip scanning wifi when geolocation permission wasn't already granted, or else the MLSFallback would present the system prompt in question, despite the user having already denied permission. On the other hand, we need the old scanning behavior for this case when running versions of Windows 10 and 11 that don't have these updates. (The updates are set to appear in the 24H2 version of Windows 11.) This approach avoids that kind of version special-casing. Differential Revision: https://phabricator.services.mozilla.com/D218589
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			946 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			946 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 | |
| /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 | |
| /* This Source Code Form is subject to the terms of the Mozilla Public
 | |
|  * License, v. 2.0. If a copy of the MPL was not distributed with this
 | |
|  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 | |
| 
 | |
| #include "GeolocationSystem.h"
 | |
| 
 | |
| namespace mozilla::dom::geolocation {
 | |
| 
 | |
| SystemGeolocationPermissionBehavior GetGeolocationPermissionBehavior() {
 | |
|   return SystemGeolocationPermissionBehavior::NoPrompt;
 | |
| }
 | |
| 
 | |
| already_AddRefed<SystemGeolocationPermissionRequest>
 | |
| RequestLocationPermissionFromUser(BrowsingContext* aBrowsingContext,
 | |
|                                   ParentRequestResolver&& aResolver) {
 | |
|   MOZ_ASSERT_UNREACHABLE(
 | |
|       "Should not warn user of need for system location permission "
 | |
|       "since we cannot open system settings on this platform.");
 | |
|   return nullptr;
 | |
| }
 | |
| 
 | |
| }  // namespace mozilla::dom::geolocation
 |