Backed out changeset b2ef6a444640 (bug 1046554) since the gaia part has been reverted

This commit is contained in:
Ed Morley 2014-08-06 16:58:31 +01:00
parent 87f4ab810e
commit f822655e4e
6 changed files with 7 additions and 39 deletions

View File

@ -261,10 +261,6 @@ const kEventConstructors = {
return new MozMmsEvent(aName, aProps);
},
},
MozNFCPeerEvent: { create: function (aName, aProps) {
return new MozNFCPeerEvent(aName, aProps);
},
},
MozOtaStatusEvent: { create: function (aName, aProps) {
return new MozOtaStatusEvent(aName, aProps);
},

View File

@ -157,6 +157,10 @@ mozNfc.prototype = {
_window: null,
nfcObject: null,
_wrap: function _wrap(obj) {
return Cu.cloneInto(obj, this._window);
},
init: function init(aWindow) {
debug("mozNfc init called");
this._window = aWindow;
@ -267,10 +271,10 @@ mozNfc.prototype = {
this.session = sessionToken;
debug("fire onpeerready sessionToken : " + sessionToken);
let eventData = {
"peer":this.getNFCPeer(sessionToken)
let detail = {
"detail":sessionToken
};
let event = new this._window.MozNFCPeerEvent("peerready", eventData);
let event = new this._window.CustomEvent("peerready", this._wrap(detail));
this.__DOM_IMPL__.dispatchEvent(event);
},

View File

@ -687,8 +687,6 @@ var interfaceNamesInGlobalScope =
{name: "MozNDEFRecord", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozNFCPeer", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozNFCPeerEvent", b2g: true, permission: "nfc-write"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozNFCTag", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -51,11 +51,6 @@ interface MozNFC : EventTarget {
[Throws]
MozNFCPeer getNFCPeer(DOMString sessionId);
/**
* This event will be fired when another NFCPeer is detected, and user confirms
* to share data to the NFCPeer object by calling mozNFC.notifyUserAcceptedP2P.
* The event will be type of NFCPeerEvent.
*/
[CheckPermissions="nfc-write"]
attribute EventHandler onpeerready;
[CheckPermissions="nfc-write"]

View File

@ -1,20 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString type, optional MozNFCPeerEventInit eventInitDict),
Func="Navigator::HasNFCSupport"]
interface MozNFCPeerEvent : Event
{
/**
* The detected NFCPeer.
*/
readonly attribute MozNFCPeer? peer;
};
dictionary MozNFCPeerEventInit : EventInit
{
MozNFCPeer? peer = null;
};

View File

@ -726,11 +726,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
'MozWifiStatusChangeEvent.webidl',
]
if CONFIG['MOZ_NFC']:
GENERATED_EVENTS_WEBIDL_FILES += [
'MozNFCPeerEvent.webidl',
]
if CONFIG['MOZ_BUILD_APP'] in ['browser', 'xulrunner']:
WEBIDL_FILES += [
'BrowserFeedWriter.webidl',