mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 883522 - Add a message attribute to nsIDOMGeoPositionError.idl and a GetMessage method to nsGeolocation.cpp. r=jdm
This commit is contained in:
parent
f9d83485ab
commit
9112d46f2c
@ -5,7 +5,7 @@
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(AD9FA4C8-EC71-4B2D-8294-9ADF06DDEC32)]
|
||||
[scriptable, uuid(85255CC3-07BA-49FD-BC9B-18D2963DAF7F)]
|
||||
interface nsIDOMGeoPositionError : nsISupports
|
||||
{
|
||||
const unsigned short PERMISSION_DENIED = 1;
|
||||
@ -13,4 +13,5 @@ interface nsIDOMGeoPositionError : nsISupports
|
||||
const unsigned short TIMEOUT = 3;
|
||||
|
||||
readonly attribute short code;
|
||||
readonly attribute AString message;
|
||||
};
|
||||
|
@ -255,6 +255,26 @@ PositionError::GetCode(int16_t *aCode)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PositionError::GetMessage(nsAString& aMessage)
|
||||
{
|
||||
switch (mCode)
|
||||
{
|
||||
case nsIDOMGeoPositionError::PERMISSION_DENIED:
|
||||
aMessage = NS_LITERAL_STRING("User denied geolocation prompt");
|
||||
break;
|
||||
case nsIDOMGeoPositionError::POSITION_UNAVAILABLE:
|
||||
aMessage = NS_LITERAL_STRING("Unknown error acquiring position");
|
||||
break;
|
||||
case nsIDOMGeoPositionError::TIMEOUT:
|
||||
aMessage = NS_LITERAL_STRING("Position acquisition timed out");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Geolocation*
|
||||
PositionError::GetParentObject() const
|
||||
{
|
||||
|
@ -296,10 +296,6 @@ public:
|
||||
return mCode;
|
||||
}
|
||||
|
||||
void GetMessage(nsString& aRetVal) const {
|
||||
aRetVal.Truncate();
|
||||
}
|
||||
|
||||
void NotifyCallback(const GeoPositionErrorCallback& callback);
|
||||
private:
|
||||
~PositionError();
|
||||
|
Loading…
Reference in New Issue
Block a user