Bug 942104 - Add an event listener "ondiscoverystatechanged", r=gyeh, r=mrbkap
authorEric Chou <echou@mozilla.com>
Fri, 23 May 2014 14:00:14 +0800
changeset 197107 b6f247ae6aef612177143f86ed74a277cf7a8e08
parent 197106 899cacc6bee9217489b391e6bd9bcc393bd1c613
child 197108 61392a3cbbbb0da78d99690f714744bc95b8e92f
push idunknown
push userunknown
push dateunknown
reviewersgyeh, mrbkap
bugs942104
milestone32.0a1
Bug 942104 - Add an event listener "ondiscoverystatechanged", r=gyeh, r=mrbkap
content/base/src/nsGkAtomList.h
dom/bluetooth/BluetoothAdapter.h
dom/bluetooth/BluetoothCommon.h
dom/webidl/BluetoothAdapter.webidl
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -699,16 +699,17 @@ GK_ATOM(ondblclick, "ondblclick")
 GK_ATOM(ondeliverysuccess, "ondeliverysuccess")
 GK_ATOM(ondeliveryerror, "ondeliveryerror")
 GK_ATOM(ondevicefound, "ondevicefound")
 GK_ATOM(ondialing, "ondialing")
 GK_ATOM(ondisabled, "ondisabled")
 GK_ATOM(ondischargingtimechange, "ondischargingtimechange")
 GK_ATOM(ondisconnected, "ondisconnected")
 GK_ATOM(ondisconnecting, "ondisconnecting")
+GK_ATOM(ondiscoverystatechanged, "ondiscoverystatechanged")
 GK_ATOM(ondownloading, "ondownloading")
 GK_ATOM(onDOMActivate, "onDOMActivate")
 GK_ATOM(onDOMAttrModified, "onDOMAttrModified")
 GK_ATOM(onDOMCharacterDataModified, "onDOMCharacterDataModified")
 GK_ATOM(onDOMFocusIn, "onDOMFocusIn")
 GK_ATOM(onDOMFocusOut, "onDOMFocusOut")
 GK_ATOM(onDOMMouseScroll, "onDOMMouseScroll")
 GK_ATOM(onDOMNodeInserted, "onDOMNodeInserted")
--- a/dom/bluetooth/BluetoothAdapter.h
+++ b/dom/bluetooth/BluetoothAdapter.h
@@ -143,16 +143,17 @@ public:
   already_AddRefed<DOMRequest> ToggleCalls(ErrorResult& aRv);
 
   already_AddRefed<DOMRequest>
     SendMediaMetaData(const MediaMetaData& aMediaMetaData, ErrorResult& aRv);
   already_AddRefed<DOMRequest>
     SendMediaPlayStatus(const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv);
 
   IMPL_EVENT_HANDLER(devicefound);
+  IMPL_EVENT_HANDLER(discoverystatechanged);
   IMPL_EVENT_HANDLER(a2dpstatuschanged);
   IMPL_EVENT_HANDLER(hfpstatuschanged);
   IMPL_EVENT_HANDLER(pairedstatuschanged);
   IMPL_EVENT_HANDLER(requestmediaplaystatus);
   IMPL_EVENT_HANDLER(scostatuschanged);
 
   nsPIDOMWindow* GetParentObject() const
   {
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -107,16 +107,21 @@ extern bool gBluetoothDebugFlag;
 
 /**
  * When the pair status of a Bluetooth device is changed, we'll dispatch an
  * event.
  */
 #define PAIRED_STATUS_CHANGED_ID             "pairedstatuschanged"
 
 /**
+ * This event would be fired when discovery procedure starts or stops.
+ */
+#define DISCOVERY_STATE_CHANGED_ID           "discoverystatechanged"
+
+/**
  * When receiving a query about current play status from remote device, we'll
  * dispatch an event.
  */
 #define REQUEST_MEDIA_PLAYSTATUS_ID          "requestmediaplaystatus"
 
 // Bluetooth address format: xx:xx:xx:xx:xx:xx (or xx_xx_xx_xx_xx_xx)
 #define BLUETOOTH_ADDRESS_LENGTH 17
 #define BLUETOOTH_ADDRESS_NONE   "00:00:00:00:00:00"
--- a/dom/webidl/BluetoothAdapter.webidl
+++ b/dom/webidl/BluetoothAdapter.webidl
@@ -46,16 +46,19 @@ interface BluetoothAdapter : EventTarget
   readonly attribute any            devices;
 
   // array of type DOMString[]
   [GetterThrows]
   readonly attribute any            uuids;
 
            attribute EventHandler   ondevicefound;
 
+  // Fired when discovery process has been done or has started
+           attribute EventHandler   ondiscoverystatechanged;
+
   // Fired when pairing process is completed
            attribute EventHandler   onpairedstatuschanged;
 
   // Fired when a2dp connection status changed
            attribute EventHandler   ona2dpstatuschanged;
 
   // Fired when handsfree connection status changed
            attribute EventHandler   onhfpstatuschanged;