Bug 674741 - Part 2: NFC DOM Boilerplate. r=smaug

--HG--
extra : rebase_source : e3a2a50da058df3bae914d748d7e4e8965a5134f
This commit is contained in:
Garner Lee 2013-10-02 15:09:08 -07:00
parent c764deaac4
commit d2cbb92ee9
2 changed files with 15 additions and 0 deletions

View File

@ -1793,6 +1793,18 @@ Navigator::HasFMRadioSupport(JSContext* /* unused */, JSObject* aGlobal)
}
#endif // MOZ_B2G_FM
#ifdef MOZ_NFC
/* static */
bool
Navigator::HasNfcSupport(JSContext* /* unused */, JSObject* aGlobal)
{
nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
return win && (CheckPermission(win, "nfc-read") ||
CheckPermission(win, "nfc-write"));
}
#endif // MOZ_NFC
#ifdef MOZ_TIME_MANAGER
/* static */
bool

View File

@ -287,6 +287,9 @@ public:
#ifdef MOZ_B2G_FM
static bool HasFMRadioSupport(JSContext* /* unused */, JSObject* aGlobal);
#endif // MOZ_B2G_FM
#ifdef MOZ_NFC
static bool HasNfcSupport(JSContext* /* unused */, JSObject* aGlobal);
#endif // MOZ_NFC
#ifdef MOZ_TIME_MANAGER
static bool HasTimeSupport(JSContext* /* unused */, JSObject* aGlobal);
#endif // MOZ_TIME_MANAGER