Bug 1048676 - Part 1: WebIDL and DOM change. r=smaug, dimi

From 28e46b34f04d20d5f10c14a85e77ec1ac98aad9e Mon Sep 17 00:00:00 2001
---
 dom/apps/PermissionsTable.jsm     | 9 +++++++--
 dom/nfc/nsNfc.js                  | 9 +++++----
 dom/webidl/MozNFC.webidl          | 8 ++------
 dom/webidl/MozNFCPeer.webidl      | 2 +-
 dom/webidl/MozNFCPeerEvent.webidl | 2 +-
 dom/webidl/MozNFCTagEvent.webidl  | 2 +-
 6 files changed, 17 insertions(+), 15 deletions(-)
This commit is contained in:
Yoshi Huang 2014-11-06 11:12:38 +08:00
Родитель 13bd1becaf
Коммит 215cbc771b
6 изменённых файлов: 17 добавлений и 15 удалений

Просмотреть файл

@ -411,8 +411,13 @@ this.PermissionsTable = { geolocation: {
app: DENY_ACTION,
trusted: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION,
access: ["read", "write"]
certified: ALLOW_ACTION
},
"nfc-share": {
app: DENY_ACTION,
trusted: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"nfc-manager": {
app: DENY_ACTION,

Просмотреть файл

@ -389,7 +389,7 @@ MozNFCImpl.prototype = {
return;
}
if (!this.checkPermissions(["nfc-read", "nfc-write"])) {
if (!this.checkPermissions(["nfc"])) {
return;
}
@ -426,7 +426,7 @@ MozNFCImpl.prototype = {
return;
}
if (!this.checkPermissions(["nfc-read", "nfc-write"])) {
if (!this.checkPermissions(["nfc"])) {
return;
}
@ -461,7 +461,8 @@ MozNFCImpl.prototype = {
return;
}
if (!this.checkPermissions(["nfc-write"])) {
let perm = isPeerReady ? ["nfc-share"] : ["nfc"];
if (!this.checkPermissions(perm)) {
return;
}
@ -483,7 +484,7 @@ MozNFCImpl.prototype = {
return;
}
if (!this.checkPermissions(["nfc-write"])) {
if (!this.checkPermissions(["nfc", "nfc-share"])) {
return;
}

Просмотреть файл

@ -78,7 +78,7 @@ interface MozNFCManager {
[JSImplementation="@mozilla.org/navigatorNfc;1",
NavigatorProperty="mozNfc",
Func="Navigator::HasNFCSupport",
CheckPermissions="nfc-read nfc-write",
CheckPermissions="nfc nfc-share",
AvailableIn="CertifiedApps"]
interface MozNFC : EventTarget {
/**
@ -86,32 +86,28 @@ interface MozNFC : EventTarget {
* to share data to the NFCPeer object by calling mozNFC.notifyUserAcceptedP2P.
* The event will be type of NFCPeerEvent.
*/
[CheckPermissions="nfc-write"]
[CheckPermissions="nfc-share"]
attribute EventHandler onpeerready;
/**
* This event will be fired when a NFCPeer is detected.
*/
[CheckPermissions="nfc-write"]
attribute EventHandler onpeerfound;
/**
* This event will be fired when NFCPeer, earlier detected in onpeerready
* or onpeerfound, moves out of range.
*/
[CheckPermissions="nfc-write"]
attribute EventHandler onpeerlost;
/**
* Ths event will be fired when a NFCTag is detected.
*/
[CheckPermissions="nfc-read nfc-write"]
attribute EventHandler ontagfound;
/**
* This event will be fired if the tag detected in ontagfound has been removed.
*/
[CheckPermissions="nfc-read nfc-write"]
attribute EventHandler ontaglost;
};

Просмотреть файл

@ -19,7 +19,7 @@ interface MozNFCPeer {
/**
* Send file to peer device.
*/
[Throws]
[Throws, CheckPermissions="nfc-share"]
Promise<void> sendFile(Blob blob);
};

Просмотреть файл

@ -5,7 +5,7 @@
*/
[Constructor(DOMString type, optional MozNFCPeerEventInit eventInitDict),
Func="Navigator::HasNFCSupport", CheckPermissions="nfc-write",
Func="Navigator::HasNFCSupport", CheckPermissions="nfc nfc-share",
AvailableIn="CertifiedApps"]
interface MozNFCPeerEvent : Event
{

Просмотреть файл

@ -5,7 +5,7 @@
*/
[Constructor(DOMString type, optional MozNFCTagEventInit eventInitDict),
Func="Navigator::HasNFCSupport", CheckPermissions="nfc-read nfc-write",
Func="Navigator::HasNFCSupport", CheckPermissions="nfc",
AvailableIn="CertifiedApps"]
interface MozNFCTagEvent : Event
{