Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: chrome/common/extensions/api/events.json

Issue 10392127: Move declarative API into events API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix change schema type reference from 'Event' to 'events.Event' Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/events.json
diff --git a/chrome/common/extensions/api/declarative.json b/chrome/common/extensions/api/events.json
similarity index 56%
rename from chrome/common/extensions/api/declarative.json
rename to chrome/common/extensions/api/events.json
index bf5ab508e38e462569f305d5e1dfa351662f76c4..9eac5a23077266be19e52c657d7f94ea2a00a03a 100644
--- a/chrome/common/extensions/api/declarative.json
+++ b/chrome/common/extensions/api/events.json
@@ -4,11 +4,117 @@
[
{
- "namespace": "declarative",
+ "namespace": "events",
"internal": true,
- "documentation_permissions_required": ["declarative"],
+ "unprivileged": true,
"types": [
{
+ "id": "Event",
+ "type": "object",
+ "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": "addRules",
+ "type": "function",
+ "description": "Registers rules to handle events. Note that you cannot call this function as <code>chrome.declarative.addRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.",
+ "parameters": [
+ {
+ "nodoc": "true",
+ "name": "eventName",
+ "type": "string",
+ "description": "Name of the event this function affects."
+ },
+ {
+ "name": "rules",
+ "type": "array",
+ "items": {"$ref": "Rule"},
+ "description": "Rules to be registered. These do not replace previously registered rules."
+ },
+ {
+ "name": "callback",
+ "optional": true,
+ "type": "function",
+ "parameters": [
+ {
+ "name": "rules",
+ "type": "array",
+ "items": {"$ref": "Rule"},
+ "description": "Rules that were registered, the optional parameters are filled with values."
+ }
+ ],
+ "description": "Called with registered rules."
+ }
+ ]
+ },
+ {
+ "name": "getRules",
+ "type": "function",
+ "description": "Returns currently registered rules. Note that you cannot call this function as <code>chrome.declarative.getRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.",
+ "parameters": [
+ {
+ "nodoc": "true",
+ "name": "eventName",
+ "type": "string",
+ "description": "Name of the event this function affects."
+ },
+ {
+ "name": "ruleIdentifiers",
+ "optional": "true",
+ "type": "array",
+ "items": {"type": "string"},
+ "description": "If an array is passed, only rules with identifiers contained in this array are returned."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "rules",
+ "type": "array",
+ "items": {"$ref": "Rule"},
+ "description": "Rules that were registered, the optional parameters are filled with values."
+ }
+ ],
+ "description": "Called with registered rules."
+ }
+ ]
+ },
+ {
+ "name": "removeRules",
+ "type": "function",
+ "description": "Unregisters currently registered rules. Note that you cannot call this function as <code>chrome.declarative.removeRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.",
+ "parameters": [
+ {
+ "nodoc": "true",
+ "name": "eventName",
+ "type": "string",
+ "description": "Name of the event this function affects."
+ },
+ {
+ "name": "ruleIdentifiers",
+ "optional": "true",
+ "type": "array",
+ "items": {"type": "string"},
+ "description": "If an array is passed, only rules with identifiers contained in this array are unregistered."
+ },
+ {
+ "name": "callback",
+ "optional": true,
+ "type": "function",
+ "parameters": [],
+ "description": "Called when rules were unregistered."
+ }
+ ]
+ }
+ ]
+ },
+ {
"id": "Rule",
"type": "object",
"description": "Description of a declarative rule for handling events.",
@@ -135,101 +241,6 @@
}
}
}
- ],
- "functions": [
- {
- "name": "addRules",
- "type": "function",
- "description": "Registers rules to handle events. Note that you cannot call this function as <code>chrome.declarative.addRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.",
- "parameters": [
- {
- "nodoc": "true",
- "name": "eventName",
- "type": "string",
- "description": "Name of the event this function affects."
- },
- {
- "name": "rules",
- "type": "array",
- "items": {"$ref": "Rule"},
- "description": "Rules to be registered. These do not replace previously registered rules."
- },
- {
- "name": "callback",
- "optional": true,
- "type": "function",
- "parameters": [
- {
- "name": "rules",
- "type": "array",
- "items": {"$ref": "Rule"},
- "description": "Rules that were registered, the optional parameters are filled with values."
- }
- ],
- "description": "Called with registered rules."
- }
- ]
- },
- {
- "name": "getRules",
- "type": "function",
- "description": "Returns currently registered rules. Note that you cannot call this function as <code>chrome.declarative.getRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.",
- "parameters": [
- {
- "nodoc": "true",
- "name": "eventName",
- "type": "string",
- "description": "Name of the event this function affects."
- },
- {
- "name": "ruleIdentifiers",
- "optional": "true",
- "type": "array",
- "items": {"type": "string"},
- "description": "If an array is passed, only rules with identifiers contained in this array are returned."
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "rules",
- "type": "array",
- "items": {"$ref": "Rule"},
- "description": "Rules that were registered, the optional parameters are filled with values."
- }
- ],
- "description": "Called with registered rules."
- }
- ]
- },
- {
- "name": "removeRules",
- "type": "function",
- "description": "Unregisters currently registered rules. Note that you cannot call this function as <code>chrome.declarative.removeRules(...)</code>. Instead a function of this signature is provided for event objects supporting the declarative API such as <code>chrome.declarativeWebRequest.onRequest</code>.",
- "parameters": [
- {
- "nodoc": "true",
- "name": "eventName",
- "type": "string",
- "description": "Name of the event this function affects."
- },
- {
- "name": "ruleIdentifiers",
- "optional": "true",
- "type": "array",
- "items": {"type": "string"},
- "description": "If an array is passed, only rules with identifiers contained in this array are unregistered."
- },
- {
- "name": "callback",
- "optional": true,
- "type": "function",
- "parameters": [],
- "description": "Called when rules were unregistered."
- }
- ]
- }
]
}
]
« no previous file with comments | « chrome/common/extensions/api/declarative_web_request.json ('k') | chrome/common/extensions/api/extension.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698