summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/events.json
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-20 14:08:02 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-20 14:08:02 +0000
commit9889f42a78b3782105e157a5e05ca2d657d860ab (patch)
tree3418be99f96f389419cd6796720ead21b817d440 /chrome/common/extensions/api/events.json
parentef108e7c130e04a2cc8779a0aa3c548180cd08fb (diff)
downloadchromium_src-9889f42a78b3782105e157a5e05ca2d657d860ab.zip
chromium_src-9889f42a78b3782105e157a5e05ca2d657d860ab.tar.gz
chromium_src-9889f42a78b3782105e157a5e05ca2d657d860ab.tar.bz2
Document signatures for Event.[add|remove|has]Listener()
BUG=132950 TEST=no Review URL: https://chromiumcodereview.appspot.com/10553002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143168 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/api/events.json')
-rw-r--r--chrome/common/extensions/api/events.json57
1 files changed, 52 insertions, 5 deletions
diff --git a/chrome/common/extensions/api/events.json b/chrome/common/extensions/api/events.json
index 25c8fa9..da3369413 100644
--- a/chrome/common/extensions/api/events.json
+++ b/chrome/common/extensions/api/events.json
@@ -14,11 +14,58 @@
"description": "An object which allows the addition and removal of listeners for a Chrome event.",
"additionalProperties": { "type": "any"},
"functions": [
- // TODO(battre): Add correct signatures.
- { "name": "addListener", "type": "function", "parameters": [] },
- { "name": "removeListener", "type": "function", "parameters": [] },
- { "name": "hasListener", "type": "function", "parameters": [] },
- { "name": "hasListeners", "type": "function", "parameters": [] },
+ {
+ "name": "addListener",
+ "nocompile": true,
+ "type": "function",
+ "description": "Registers an event listener <em>callback</em> to an event.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when an event occurs. The parameters of this function depend on the type of event."
+ }
+ ]
+ },
+ {
+ "name": "removeListener",
+ "nocompile": true,
+ "type": "function",
+ "description": "Deregisters an event listener <em>callback</em> from an event.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Listener that shall be unregistered."
+ }
+ ]
+ },
+ {
+ "name": "hasListener",
+ "nocompile": true,
+ "type": "function",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Listener whose registration status shall be tested."
+ }
+ ],
+ "returns": {
+ "type": "boolean",
+ "description": "True if <em>callback</em> is registered to the event."
+ }
+ },
+ {
+ "name": "hasListeners",
+ "nocompile": true,
+ "type": "function",
+ "parameters": [],
+ "returns": {
+ "type": "boolean",
+ "description": "True if any event listeners are registered to the event."
+ }
+ },
{
"name": "addRules",
"type": "function",