Bug 928217 - Remove IsCoreLocationAvailable() method because it does the wrong thing. r=smichaud@pobox.com

This commit is contained in:
Doug Turner 2014-03-16 19:54:04 -07:00
parent e6388b7f5b
commit 23d2cb13fd
3 changed files with 1 additions and 41 deletions

View File

@ -688,8 +688,7 @@ nsresult nsGeolocationService::Init()
#endif #endif
#ifdef MOZ_WIDGET_COCOA #ifdef MOZ_WIDGET_COCOA
if (Preferences::GetBool("geo.provider.use_corelocation", true) && if (Preferences::GetBool("geo.provider.use_corelocation", false)) {
CoreLocationLocationProvider::IsCoreLocationAvailable()) {
mProvider = new CoreLocationLocationProvider(); mProvider = new CoreLocationLocationProvider();
} }
#endif #endif

View File

@ -30,8 +30,6 @@ public:
NS_DECL_NSIGEOLOCATIONPROVIDER NS_DECL_NSIGEOLOCATIONPROVIDER
CoreLocationLocationProvider(); CoreLocationLocationProvider();
static bool IsCoreLocationAvailable();
void NotifyError(uint16_t aErrorCode); void NotifyError(uint16_t aErrorCode);
void Update(nsIDOMGeoPosition* aSomewhere); void Update(nsIDOMGeoPosition* aSomewhere);
private: private:

View File

@ -22,7 +22,6 @@
#include <objc/objc-runtime.h> #include <objc/objc-runtime.h>
#include "nsObjCExceptions.h" #include "nsObjCExceptions.h"
#import <CoreWLAN/CoreWLAN.h>
using namespace mozilla; 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 NS_IMETHODIMP
CoreLocationLocationProvider::Startup() CoreLocationLocationProvider::Startup()
{ {