Disable geolocation prompt in minimal simulator mode
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2018 20:22:18 +0000 (20:22 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2018 20:22:18 +0000 (20:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183991
<rdar://problem/38845774>

Reviewed by Dan Bernstein.

* Misc/WebGeolocationCoreLocationProvider.mm:
(-[WebGeolocationCoreLocationProvider requestGeolocationAuthorization]):
* Misc/WebGeolocationProviderIOS.mm:
(-[WebGeolocationProviderIOS registerWebView:]):
(-[WebGeolocationProviderIOS initializeGeolocationForWebView:listener:]):
Also clean up some unnecessary nested #ifs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229963 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKitLegacy/ios/ChangeLog
Source/WebKitLegacy/ios/Misc/WebGeolocationCoreLocationProvider.mm
Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm

index e201627..6f035ae 100644 (file)
@@ -1,3 +1,18 @@
+2018-03-25  Tim Horton  <timothy_horton@apple.com>
+
+        Disable geolocation prompt in minimal simulator mode
+        https://bugs.webkit.org/show_bug.cgi?id=183991
+        <rdar://problem/38845774>
+
+        Reviewed by Dan Bernstein.
+
+        * Misc/WebGeolocationCoreLocationProvider.mm:
+        (-[WebGeolocationCoreLocationProvider requestGeolocationAuthorization]):
+        * Misc/WebGeolocationProviderIOS.mm:
+        (-[WebGeolocationProviderIOS registerWebView:]):
+        (-[WebGeolocationProviderIOS initializeGeolocationForWebView:listener:]):
+        Also clean up some unnecessary nested #ifs.
+
 2018-02-06  Don Olmstead  <don.olmstead@sony.com>
 
         Remove WebCore/ForwardingHeaders directory
index d9f033a..9c74f80 100644 (file)
@@ -89,6 +89,10 @@ using namespace WebCore;
 
 - (void)requestGeolocationAuthorization
 {
+#if ENABLE(MINIMAL_SIMULATOR)
+    [_positionListener geolocationAuthorizationDenied];
+    return;
+#else
     if (![getCLLocationManagerClass() locationServicesEnabled]) {
         [_positionListener geolocationAuthorizationDenied];
         return;
@@ -112,6 +116,7 @@ using namespace WebCore;
         [_positionListener geolocationAuthorizationDenied];
         break;
     }
+#endif
 }
 
 static bool isAuthorizationGranted(CLAuthorizationStatus authorizationStatus)
index 73d00b4..27da23b 100644 (file)
@@ -27,6 +27,7 @@
 
 #import "WebGeolocationProviderIOS.h"
 
+#import "WebDelegateImplementationCaching.h"
 #import "WebGeolocationCoreLocationProvider.h"
 #import <WebGeolocationPosition.h>
 #import <WebCore/GeolocationPosition.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/Vector.h>
 
-#if PLATFORM(IOS)
-#import "WebDelegateImplementationCaching.h"
-#endif
-
 using namespace WebCore;
 
 @interface WebGeolocationPosition (Internal)
@@ -176,10 +173,8 @@ static inline void abortSendLastPosition(WebGeolocationProviderIOS* provider)
         return;
 
     _registeredWebViews.add(webView);
-#if PLATFORM(IOS)
     if (!CallUIDelegateReturningBoolean(YES, webView, @selector(webViewCanCheckGeolocationAuthorizationStatus:)))
         return;
-#endif
 
     if (!_isSuspended) {
         dispatch_async(dispatch_get_main_queue(), ^{
@@ -239,10 +234,9 @@ static inline void abortSendLastPosition(WebGeolocationProviderIOS* provider)
 {
     ASSERT(WebThreadIsLockedOrDisabled());
 
-#if PLATFORM(IOS)
     if (!CallUIDelegateReturningBoolean(YES, webView, @selector(webViewCanCheckGeolocationAuthorizationStatus:)))
         return;
-#endif
+
     _webViewsWaitingForCoreLocationAuthorization.add(webView, listener);
     _trackedWebViews.add(webView);