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

Side by Side Diff: chrome/common/extensions/api/runtime.json

Issue 14494013: Allow API functions and events to have entries in _api_features.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bug in searching for unprivileged Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 [ 5 [
6 { 6 {
7 "namespace": "runtime", 7 "namespace": "runtime",
8 "documentation_permissions_required": ["runtime"], 8 "documentation_permissions_required": ["runtime"],
9 "types": [ 9 "types": [
10 { 10 {
(...skipping 24 matching lines...) Expand all
35 "id": {"type": "string", "description": "The ID of the extension or ap p that opened the connection."}, 35 "id": {"type": "string", "description": "The ID of the extension or ap p that opened the connection."},
36 "url": {"type": "string", "optional": true, "description": "The URL of the page or frame that opened the connection. This property will <strong>only</ strong> be present when the connection was opened from a tab (including content scripts)."} 36 "url": {"type": "string", "optional": true, "description": "The URL of the page or frame that opened the connection. This property will <strong>only</ strong> be present when the connection was opened from a tab (including content scripts)."}
37 } 37 }
38 } 38 }
39 ], 39 ],
40 "properties": { 40 "properties": {
41 "lastError": { 41 "lastError": {
42 "type": "object", 42 "type": "object",
43 "optional": true, 43 "optional": true,
44 "description": "This will be defined during an API method callback if th ere was an error", 44 "description": "This will be defined during an API method callback if th ere was an error",
45 "unprivileged": true,
46 "properties": { 45 "properties": {
47 "message": { 46 "message": {
48 "optional": true, 47 "optional": true,
49 "type": "string", 48 "type": "string",
50 "description": "Details about the error which occurred." 49 "description": "Details about the error which occurred."
51 } 50 }
52 } 51 }
53 }, 52 },
54 "id": { 53 "id": {
55 "type": "string", 54 "type": "string",
56 "description": "The ID of the extension/app.", 55 "description": "The ID of the extension/app."
57 "unprivileged": true
58 } 56 }
59 }, 57 },
60 "functions": [ 58 "functions": [
61 { 59 {
62 "name": "getBackgroundPage", 60 "name": "getBackgroundPage",
63 "type": "function", 61 "type": "function",
64 "description": "Retrieves the JavaScript 'window' object for the backgro und page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.", 62 "description": "Retrieves the JavaScript 'window' object for the backgro und page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.",
65 "parameters": [ 63 "parameters": [
66 { 64 {
67 "type": "function", 65 "type": "function",
(...skipping 11 matching lines...) Expand all
79 } 77 }
80 ] 78 ]
81 } 79 }
82 ] 80 ]
83 }, 81 },
84 { 82 {
85 "name": "getManifest", 83 "name": "getManifest",
86 "description": "Returns details about the app or extension from the mani fest. The object returned is a serialization of the full <a href=\"manifest.html \">manifest file</a>.", 84 "description": "Returns details about the app or extension from the mani fest. The object returned is a serialization of the full <a href=\"manifest.html \">manifest file</a>.",
87 "type": "function", 85 "type": "function",
88 "nocompile": true, 86 "nocompile": true,
89 "unprivileged": true,
90 "parameters": [], 87 "parameters": [],
91 "returns": { 88 "returns": {
92 "type": "object", 89 "type": "object",
93 "properties": {}, 90 "properties": {},
94 "additionalProperties": { "type": "any" }, 91 "additionalProperties": { "type": "any" },
95 "description": "The manifest details." 92 "description": "The manifest details."
96 } 93 }
97 }, 94 },
98 { 95 {
99 "name": "getURL", 96 "name": "getURL",
100 "type": "function", 97 "type": "function",
101 "nocompile": true, 98 "nocompile": true,
102 "unprivileged": true,
103 "description": "Converts a relative path within an app/extension install directory to a fully-qualified URL.", 99 "description": "Converts a relative path within an app/extension install directory to a fully-qualified URL.",
104 "parameters": [ 100 "parameters": [
105 { 101 {
106 "type": "string", 102 "type": "string",
107 "name": "path", 103 "name": "path",
108 "description": "A path to a resource within an app/extension express ed relative to its install directory." 104 "description": "A path to a resource within an app/extension express ed relative to its install directory."
109 } 105 }
110 ], 106 ],
111 "returns": { 107 "returns": {
112 "type": "string", 108 "type": "string",
113 "description": "The fully-qualified URL to the resource." 109 "description": "The fully-qualified URL to the resource."
114 } 110 }
115 }, 111 },
116 { 112 {
117 "name": "reload", 113 "name": "reload",
118 "description": "Reloads the app or extension.", 114 "description": "Reloads the app or extension.",
119 "type": "function", 115 "type": "function",
120 "nocompile": true, 116 "nocompile": true,
121 "unprivileged": true,
122 "parameters": [] 117 "parameters": []
123 }, 118 },
124 { 119 {
125 "name": "requestUpdateCheck", 120 "name": "requestUpdateCheck",
126 "type": "function", 121 "type": "function",
127 "unprivileged": true,
128 "description": "Requests an update check for this app/extension.", 122 "description": "Requests an update check for this app/extension.",
129 "parameters": [ 123 "parameters": [
130 { 124 {
131 "type": "function", 125 "type": "function",
132 "name": "callback", 126 "name": "callback",
133 "parameters": [ 127 "parameters": [
134 { 128 {
135 "name": "status", 129 "name": "status",
136 "type": "string", 130 "type": "string",
137 "enum": ["throttled", "no_update", "update_available"], 131 "enum": ["throttled", "no_update", "update_available"],
(...skipping 12 matching lines...) Expand all
150 "description": "If an update is available, this contains more in formation about the available update." 144 "description": "If an update is available, this contains more in formation about the available update."
151 } 145 }
152 ] 146 ]
153 } 147 }
154 ] 148 ]
155 }, 149 },
156 { 150 {
157 "name": "connect", 151 "name": "connect",
158 "type": "function", 152 "type": "function",
159 "nocompile": true, 153 "nocompile": true,
160 "unprivileged": true,
161 "description": "Attempts to connect to other listeners within the extens ion/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes. Note that this does not connect to any listeners in a content script. Extensions may connect to con tent scripts embedded in tabs via $ref:tabs.connect.", 154 "description": "Attempts to connect to other listeners within the extens ion/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes. Note that this does not connect to any listeners in a content script. Extensions may connect to con tent scripts embedded in tabs via $ref:tabs.connect.",
162 "parameters": [ 155 "parameters": [
163 {"type": "string", "name": "extensionId", "optional": true, "descripti on": "The ID of the extension/app you want to connect to. If omitted, default is your own extension."}, 156 {"type": "string", "name": "extensionId", "optional": true, "descripti on": "The ID of the extension/app you want to connect to. If omitted, default is your own extension."},
164 { 157 {
165 "type": "object", 158 "type": "object",
166 "name": "connectInfo", 159 "name": "connectInfo",
167 "properties": { 160 "properties": {
168 "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for processes that are listening for the connection ev ent." } 161 "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for processes that are listening for the connection ev ent." }
169 }, 162 },
170 "optional": true 163 "optional": true
(...skipping 19 matching lines...) Expand all
190 "returns": { 183 "returns": {
191 "$ref": "Port", 184 "$ref": "Port",
192 "description": "Port through which messages can be sent and received w ith the application" 185 "description": "Port through which messages can be sent and received w ith the application"
193 } 186 }
194 }, 187 },
195 { 188 {
196 "name": "sendMessage", 189 "name": "sendMessage",
197 "type": "function", 190 "type": "function",
198 "nocompile": true, 191 "nocompile": true,
199 "allowAmbiguousOptionalArguments": true, 192 "allowAmbiguousOptionalArguments": true,
200 "unprivileged": true,
201 "description": "Sends a single message to onMessage event listeners with in the extension (or another extension/app). Similar to chrome.runtime.connect, but only sends a single message with an optional response. The $ref:runtime.onMe ssage event is fired in each extension page of the extension. Note that extensio ns cannot send messages to content scripts using this method. To send messages t o content scripts, use $ref:tabs.sendMessage.", 193 "description": "Sends a single message to onMessage event listeners with in the extension (or another extension/app). Similar to chrome.runtime.connect, but only sends a single message with an optional response. The $ref:runtime.onMe ssage event is fired in each extension page of the extension. Note that extensio ns cannot send messages to content scripts using this method. To send messages t o content scripts, use $ref:tabs.sendMessage.",
202 "parameters": [ 194 "parameters": [
203 {"type": "string", "name": "extensionId", "optional": true, "descripti on": "The extension ID of the extension you want to connect to. If omitted, defa ult is your own extension."}, 195 {"type": "string", "name": "extensionId", "optional": true, "descripti on": "The extension ID of the extension you want to connect to. If omitted, defa ult is your own extension."},
204 { "type": "any", "name": "message" }, 196 { "type": "any", "name": "message" },
205 { 197 {
206 "type": "function", 198 "type": "function",
207 "name": "responseCallback", 199 "name": "responseCallback",
208 "optional": true, 200 "optional": true,
209 "parameters": [ 201 "parameters": [
210 { 202 {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 { 341 {
350 "name": "onBrowserUpdateAvailable", 342 "name": "onBrowserUpdateAvailable",
351 "type": "function", 343 "type": "function",
352 "description": "Fired when a Chrome update is available, but isn't insta lled immediately because a browser restart is required.", 344 "description": "Fired when a Chrome update is available, but isn't insta lled immediately because a browser restart is required.",
353 "parameters": [] 345 "parameters": []
354 }, 346 },
355 { 347 {
356 "name": "onConnect", 348 "name": "onConnect",
357 "type": "function", 349 "type": "function",
358 "nocompile": true, 350 "nocompile": true,
359 "unprivileged": true,
360 "anonymous": true, 351 "anonymous": true,
361 "description": "Fired when a connection is made from either an extension process or a content script.", 352 "description": "Fired when a connection is made from either an extension process or a content script.",
362 "parameters": [ 353 "parameters": [
363 {"$ref": "Port", "name": "port"} 354 {"$ref": "Port", "name": "port"}
364 ] 355 ]
365 }, 356 },
366 { 357 {
367 "name": "onConnectExternal", 358 "name": "onConnectExternal",
368 "type": "function", 359 "type": "function",
369 "nocompile": true, 360 "nocompile": true,
370 "anonymous": true, 361 "anonymous": true,
371 "description": "Fired when a connection is made from another extension." , 362 "description": "Fired when a connection is made from another extension." ,
372 "parameters": [ 363 "parameters": [
373 {"$ref": "Port", "name": "port"} 364 {"$ref": "Port", "name": "port"}
374 ] 365 ]
375 }, 366 },
376 { 367 {
377 "name": "onMessage", 368 "name": "onMessage",
378 "type": "function", 369 "type": "function",
379 "anonymous": true, 370 "anonymous": true,
380 "unprivileged": true,
381 "description": "Fired when a message is sent from either an extension pr ocess or a content script.", 371 "description": "Fired when a message is sent from either an extension pr ocess or a content script.",
382 "parameters": [ 372 "parameters": [
383 {"name": "message", "type": "any", "description": "The message sent by the calling script."}, 373 {"name": "message", "type": "any", "description": "The message sent by the calling script."},
384 {"name": "sender", "$ref": "MessageSender" }, 374 {"name": "sender", "$ref": "MessageSender" },
385 {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON -ifiable object. If you have more than one <code>onMessage</code> listener in th e same document, then only one may send a response. This function becomes invali d when the event listener returns, unless you return true from the event listene r to indicate you wish to send a response asynchronously (this will keep the mes sage channel open to the other end until <code>sendResponse</code> is called)." } 375 {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON -ifiable object. If you have more than one <code>onMessage</code> listener in th e same document, then only one may send a response. This function becomes invali d when the event listener returns, unless you return true from the event listene r to indicate you wish to send a response asynchronously (this will keep the mes sage channel open to the other end until <code>sendResponse</code> is called)." }
386 ], 376 ],
387 "returns": { 377 "returns": {
388 "type": "boolean", 378 "type": "boolean",
389 "optional": "true", 379 "optional": "true",
390 "description": "Return true from the event listener if you wish to cal l <code>sendResponse</code> after the event listener returns." 380 "description": "Return true from the event listener if you wish to cal l <code>sendResponse</code> after the event listener returns."
(...skipping 14 matching lines...) Expand all
405 "optional": "true", 395 "optional": "true",
406 "description": "Return true from the event listener if you wish to cal l <code>sendResponse</code> after the event listener returns." 396 "description": "Return true from the event listener if you wish to cal l <code>sendResponse</code> after the event listener returns."
407 } 397 }
408 } 398 }
409 399
410 400
411 401
412 ] 402 ]
413 } 403 }
414 ] 404 ]
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension_api_unittest.cc ('k') | chrome/common/extensions/api/test.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698