From 23d2cb13fdf4d570a322627dadf4062a1351b7d8 Mon Sep 17 00:00:00 2001 From: Doug Turner Date: Sun, 16 Mar 2014 19:54:04 -0700 Subject: [PATCH] Bug 928217 - Remove IsCoreLocationAvailable() method because it does the wrong thing. r=smichaud@pobox.com --- dom/src/geolocation/nsGeolocation.cpp | 3 +- dom/system/mac/CoreLocationLocationProvider.h | 2 - .../mac/CoreLocationLocationProvider.mm | 37 ------------------- 3 files changed, 1 insertion(+), 41 deletions(-) diff --git a/dom/src/geolocation/nsGeolocation.cpp b/dom/src/geolocation/nsGeolocation.cpp index bcd04a9f4d97..a2e87a6f2ae7 100644 --- a/dom/src/geolocation/nsGeolocation.cpp +++ b/dom/src/geolocation/nsGeolocation.cpp @@ -688,8 +688,7 @@ nsresult nsGeolocationService::Init() #endif #ifdef MOZ_WIDGET_COCOA - if (Preferences::GetBool("geo.provider.use_corelocation", true) && - CoreLocationLocationProvider::IsCoreLocationAvailable()) { + if (Preferences::GetBool("geo.provider.use_corelocation", false)) { mProvider = new CoreLocationLocationProvider(); } #endif diff --git a/dom/system/mac/CoreLocationLocationProvider.h b/dom/system/mac/CoreLocationLocationProvider.h index 98e5d0ecc771..65f8aa16b8c2 100644 --- a/dom/system/mac/CoreLocationLocationProvider.h +++ b/dom/system/mac/CoreLocationLocationProvider.h @@ -30,8 +30,6 @@ public: NS_DECL_NSIGEOLOCATIONPROVIDER CoreLocationLocationProvider(); - static bool IsCoreLocationAvailable(); - void NotifyError(uint16_t aErrorCode); void Update(nsIDOMGeoPosition* aSomewhere); private: diff --git a/dom/system/mac/CoreLocationLocationProvider.mm b/dom/system/mac/CoreLocationLocationProvider.mm index 582bd79a9600..fd2afd118251 100644 --- a/dom/system/mac/CoreLocationLocationProvider.mm +++ b/dom/system/mac/CoreLocationLocationProvider.mm @@ -22,7 +22,6 @@ #include #include "nsObjCExceptions.h" -#import using namespace mozilla; @@ -132,42 +131,6 @@ CoreLocationLocationProvider::CoreLocationLocationProvider() { } -bool -CoreLocationLocationProvider::IsCoreLocationAvailable() -{ -#if !defined(MAC_OS_X_VERSION_10_9) || \ - MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 - if (nsCocoaFeatures::OnMavericksOrLater()) { - return false; - } - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - @try { - NSBundle * bundle = [[[NSBundle alloc] initWithPath:@"/System/Library/Frameworks/CoreWLAN.framework"] autorelease]; - if (!bundle) { - [pool release]; - return false; - } - - Class CWI_class = [bundle classNamed:@"CWInterface"]; - if (!CWI_class) { - [pool release]; - return false; - } - - if ([[[CWI_class interface] interfaceState] intValue] == kCWInterfaceStateRunning) { - [pool release]; - return true; - } - } - @catch(NSException *e) { - } - [pool release]; -#endif - return false; -} - NS_IMETHODIMP CoreLocationLocationProvider::Startup() {