mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
Bug 928217 - Remove IsCoreLocationAvailable() method because it does the wrong thing. r=smichaud@pobox.com
This commit is contained in:
parent
e6388b7f5b
commit
23d2cb13fd
@ -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
|
||||
|
@ -30,8 +30,6 @@ public:
|
||||
NS_DECL_NSIGEOLOCATIONPROVIDER
|
||||
|
||||
CoreLocationLocationProvider();
|
||||
static bool IsCoreLocationAvailable();
|
||||
|
||||
void NotifyError(uint16_t aErrorCode);
|
||||
void Update(nsIDOMGeoPosition* aSomewhere);
|
||||
private:
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include <objc/objc-runtime.h>
|
||||
|
||||
#include "nsObjCExceptions.h"
|
||||
#import <CoreWLAN/CoreWLAN.h>
|
||||
|
||||
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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user