diff --git a/dom/public/idl/geolocation/nsIDOMGeoPositionError.idl b/dom/public/idl/geolocation/nsIDOMGeoPositionError.idl index f2421018ec3..aa90068dd53 100644 --- a/dom/public/idl/geolocation/nsIDOMGeoPositionError.idl +++ b/dom/public/idl/geolocation/nsIDOMGeoPositionError.idl @@ -37,9 +37,14 @@ #include "domstubs.idl" -[scriptable, uuid(39928BF8-4466-4A64-BF5F-97114A5CD171)] +[scriptable, uuid(1B493214-4E58-4A40-AA4C-1AB70C6DDBEC)] interface nsIDOMGeoPositionError : nsISupports { + const unsigned short UNKNOWN_ERROR = 0; + const unsigned short PERMISSION_DENIED = 1; + const unsigned short POSITION_UNAVAILABLE = 2; + const unsigned short TIMEOUT = 3; + readonly attribute short code; readonly attribute DOMString message; }; diff --git a/dom/src/geolocation/nsGeolocation.cpp b/dom/src/geolocation/nsGeolocation.cpp index 454211e012a..fd353c34b90 100644 --- a/dom/src/geolocation/nsGeolocation.cpp +++ b/dom/src/geolocation/nsGeolocation.cpp @@ -159,7 +159,7 @@ nsGeolocationRequest::Init() // check to see if we have a geolocation provider, if not, notify an error and bail. nsRefPtr geoService = nsGeolocationService::GetInstance(); if (!geoService->HasGeolocationProvider()) { - NotifyError(NS_GEO_ERROR_CODE_LOCATION_PROVIDER_ERROR); + NotifyError(nsIDOMGeoPositionError::POSITION_UNAVAILABLE); return NS_ERROR_FAILURE;; } @@ -196,7 +196,7 @@ nsGeolocationRequest::Notify(nsITimer* aTimer) // ::Cancel, just a different error if (!mHasSentData) { - NotifyError(NS_GEO_ERROR_CODE_TIMEOUT); + NotifyError(nsIDOMGeoPositionError::TIMEOUT); // remove ourselves from the locator's callback lists. mLocator->RemoveRequest(this); } @@ -226,7 +226,7 @@ nsGeolocationRequest::GetRequestingWindow(nsIDOMWindow * *aRequestingWindow) NS_IMETHODIMP nsGeolocationRequest::Cancel() { - NotifyError(NS_GEO_ERROR_CODE_PERMISSION_ERROR); + NotifyError(nsIDOMGeoPositionError::PERMISSION_DENIED); // remove ourselves from the locators callback lists. mLocator->RemoveRequest(this); @@ -242,7 +242,7 @@ nsGeolocationRequest::Allow() if (NS_FAILED(rv)) { // Location provider error - NotifyError(NS_GEO_ERROR_CODE_LOCATION_PROVIDER_ERROR); + NotifyError(nsIDOMGeoPositionError::POSITION_UNAVAILABLE); return NS_OK; } diff --git a/dom/src/geolocation/nsGeolocation.h b/dom/src/geolocation/nsGeolocation.h index 5859d879963..1e3628ff61b 100644 --- a/dom/src/geolocation/nsGeolocation.h +++ b/dom/src/geolocation/nsGeolocation.h @@ -55,11 +55,6 @@ #include "nsIGeolocationProvider.h" -#define NS_GEO_ERROR_CODE_PERMISSION_ERROR 1 -#define NS_GEO_ERROR_CODE_LOCATION_PROVIDER_ERROR 2 -#define NS_GEO_ERROR_CODE_POSITION_NOT_FOUND 3 -#define NS_GEO_ERROR_CODE_TIMEOUT 4 - class nsGeolocationService; class nsGeolocation;