summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/extensions/api')
-rw-r--r--chrome/common/extensions/api/bluetooth.idl2
-rw-r--r--chrome/common/extensions/api/context_menus.json4
-rw-r--r--chrome/common/extensions/api/cookies.json4
-rw-r--r--chrome/common/extensions/api/extension.json190
-rw-r--r--chrome/common/extensions/api/extension_api_unittest.cc6
-rw-r--r--chrome/common/extensions/api/file_browser_private.json4
-rw-r--r--chrome/common/extensions/api/input_ime.json6
-rw-r--r--chrome/common/extensions/api/tts.json2
-rw-r--r--chrome/common/extensions/api/webstore_private.json2
9 files changed, 15 insertions, 205 deletions
diff --git a/chrome/common/extensions/api/bluetooth.idl b/chrome/common/extensions/api/bluetooth.idl
index cbc4414..3c200a5 100644
--- a/chrome/common/extensions/api/bluetooth.idl
+++ b/chrome/common/extensions/api/bluetooth.idl
@@ -156,7 +156,7 @@ namespace bluetooth {
DeviceCallback deviceCallback;
};
- // These functions all report failures via chrome.extension.lastError.
+ // These functions all report failures via chrome.runtime.lastError.
interface Functions {
// Get information about the Bluetooth adapter.
// |callback| : Called with an AdapterState object describing the adapter
diff --git a/chrome/common/extensions/api/context_menus.json b/chrome/common/extensions/api/context_menus.json
index c4113ea..5f37e87 100644
--- a/chrome/common/extensions/api/context_menus.json
+++ b/chrome/common/extensions/api/context_menus.json
@@ -78,7 +78,7 @@
{
"name": "create",
"type": "function",
- "description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.extension.lastError).",
+ "description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).",
"returns": {
"choices": [
{ "type": "integer" },
@@ -170,7 +170,7 @@
"type": "function",
"name": "callback",
"optional": true,
- "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.extension.lastError.",
+ "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.",
"parameters": []
}
]
diff --git a/chrome/common/extensions/api/cookies.json b/chrome/common/extensions/api/cookies.json
index fd3a633..fc3e53f 100644
--- a/chrome/common/extensions/api/cookies.json
+++ b/chrome/common/extensions/api/cookies.json
@@ -118,7 +118,7 @@
"min_version": "11.0.674.0",
"parameters": [
{
- "name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie that's been set. If setting failed for any reason, this will be \"null\", and \"chrome.extension.lastError\" will be set."
+ "name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie that's been set. If setting failed for any reason, this will be \"null\", and \"chrome.runtime.lastError\" will be set."
}
]
}
@@ -148,7 +148,7 @@
{
"name": "details",
"type": "object",
- "description": "Contains details about the cookie that's been removed. If removal failed for any reason, this will be \"null\", and \"chrome.extension.lastError\" will be set.",
+ "description": "Contains details about the cookie that's been removed. If removal failed for any reason, this will be \"null\", and \"chrome.runtime.lastError\" will be set.",
"optional": true,
"properties": {
"url": {"type": "string", "description": "The URL associated with the cookie that's been removed."},
diff --git a/chrome/common/extensions/api/extension.json b/chrome/common/extensions/api/extension.json
index aa21140..ed97595 100644
--- a/chrome/common/extensions/api/extension.json
+++ b/chrome/common/extensions/api/extension.json
@@ -16,24 +16,6 @@
"tab": {"$ref": "tabs.Tab", "optional": true, "description":"This property will <b>only</b> be present when the connection was opened from a tab or content script."},
"id": {"type": "string", "description": "The extension ID of the extension that opened the connection."}
}
- },
- {
- "id": "Port",
- "nodoc": true,
- "type": "object",
- "description": "(Deprecated - use runtime.Port instead) An object which allows two way communication with other pages.",
- "properties": {
- "name": {"type": "string"},
- "onDisconnect": { "$ref": "events.Event" },
- "onMessage": { "$ref": "events.Event" },
- "postMessage": {"type": "function"},
- "sender": {
- "$ref": "MessageSender",
- "optional": true,
- "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners."
- }
- },
- "additionalProperties": { "type": "any"}
}
],
"properties": {
@@ -55,55 +37,6 @@
},
"functions": [
{
- "name": "connect",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "unprivileged": true,
- "description": "(Deprecated - use runtime.connect) Attempts to connect to other listeners within the extension (such as the extension's background page). This is primarily 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 content scripts embedded in tabs via $ref:tabs.connect.",
- "parameters": [
- {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
- {
- "type": "object",
- "name": "connectInfo",
- "properties": {
- "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for extension processes that are listening for the connection event." }
- },
- "optional": true
- }
- ],
- "returns": {
- "$ref": "Port",
- "description": "Port through which messages can be sent and received with the extension. The port's $ref:extension.Port event is fired if extension does not exist. "
- }
- },
- {
- "name": "connectNative",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "description": "(Deprecated - use runtime.connectNative instead) Attempts to connect a native application in the host machine. The native application must have already registered itself in the proper directory.",
- "parameters": [
- {
- "type": "string",
- "name": "appName",
- "description": "The name of the registered app to connect to."
- },
- {
- "name": "connectionMessage",
- "description": "The object that will be passed to the registered native app on connection.",
- "type": "object",
- "additionalProperties": {
- "type": "any"
- }
- }
- ],
- "returns": {
- "$ref": "Port",
- "description": "Port through which messages can be sent and received with the application"
- }
- },
- {
"name": "sendRequest",
"nodoc": true,
"type": "function",
@@ -128,69 +61,6 @@
]
},
{
- "name": "sendMessage",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "allowAmbiguousOptionalArguments": true,
- "unprivileged": true,
- "description": "Sends a single message to other listeners within the extension. Similar to chrome.extension.connect, but only sends a single message with an optional response. The $ref:extension.onMessage event is fired in each extension page of the extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use $ref:tabs.sendMessage.",
- "parameters": [
- {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
- { "type": "any", "name": "message" },
- {
- "type": "function",
- "name": "responseCallback",
- "optional": true,
- "parameters": [
- {
- "name": "response",
- "type": "any",
- "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message."
- }
- ]
- }
- ]
- },
- {
- "name": "sendNativeMessage",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "description": "(Deprecated - use runtime.sendNativeMessage) Send a single message to a registered native application.",
- "parameters": [
- {
- "name": "registeredNativeApp",
- "description": "The name of the registered native application.",
- "type": "string"
- },
- {
- "name": "message",
- "description": "The message that will be passed to the registered native application.",
- "type": "object",
- "additionalProperties": {
- "type": "any"
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called with the response from the native application.",
- "parameters": [
- {
- "name": "nativeResponse",
- "type": "object",
- "description": "Whatever the native application responds with.",
- "additionalProperties": {
- "type": "any"
- }
- }
- ]
- }
- ]
- },
- {
"name": "getURL",
"type": "function",
"unprivileged": true,
@@ -310,29 +180,6 @@
],
"events": [
{
- "name": "onConnect",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "unprivileged": true,
- "anonymous": true,
- "description": "Fired when a connection is made from either an extension process or a content script.",
- "parameters": [
- {"$ref": "Port", "name": "port"}
- ]
- },
- {
- "name": "onConnectExternal",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "anonymous": true,
- "description": "Fired when a connection is made from another extension.",
- "parameters": [
- {"$ref": "Port", "name": "port"}
- ]
- },
- {
"name": "onRequest",
"nodoc": true,
"type": "function",
@@ -356,43 +203,6 @@
{"name": "sender", "$ref": "MessageSender" },
{"name": "sendResponse", "type": "function", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
]
- },
- {
- "name": "onMessage",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "anonymous": true,
- "unprivileged": true,
- "description": "(Deprecated - use runtime.onMessage instead) Fired when a message is sent from either an extension process or a content script.",
- "parameters": [
- {"name": "message", "type": "any", "description": "The message sent by the calling script."},
- {"name": "sender", "$ref": "MessageSender" },
- {"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 the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until <code>sendResponse</code> is called)." }
- ],
- "returns": {
- "type": "boolean",
- "optional": "true",
- "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
- }
- },
- {
- "name": "onMessageExternal",
- "nodoc": true,
- "nocompile": true,
- "type": "function",
- "anonymous": true,
- "description": "(Deprecated - use runtime.onMessageExternal instead) Fired when a message is sent from another extension. Cannot be used in a content script.",
- "parameters": [
- {"name": "message", "type": "any", "description": "The message sent by the calling script."},
- {"name": "sender", "$ref": "MessageSender" },
- {"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 the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until <code>sendResponse</code> is called)." }
- ],
- "returns": {
- "type": "boolean",
- "optional": "true",
- "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
- }
}
]
}
diff --git a/chrome/common/extensions/api/extension_api_unittest.cc b/chrome/common/extensions/api/extension_api_unittest.cc
index 18146e4..106656c 100644
--- a/chrome/common/extensions/api/extension_api_unittest.cc
+++ b/chrome/common/extensions/api/extension_api_unittest.cc
@@ -97,11 +97,11 @@ TEST(ExtensionAPI, IsPrivileged) {
scoped_ptr<ExtensionAPI> extension_api(
ExtensionAPI::CreateWithDefaultConfiguration());
- EXPECT_FALSE(extension_api->IsPrivileged("extension.connect"));
- EXPECT_FALSE(extension_api->IsPrivileged("extension.onConnect"));
+ EXPECT_FALSE(extension_api->IsPrivileged("runtime.connect"));
+ EXPECT_FALSE(extension_api->IsPrivileged("runtime.onConnect"));
// Properties are not supported yet.
- EXPECT_TRUE(extension_api->IsPrivileged("extension.lastError"));
+ EXPECT_TRUE(extension_api->IsPrivileged("runtime.lastError"));
// Default unknown names to privileged for paranoia's sake.
EXPECT_TRUE(extension_api->IsPrivileged(""));
diff --git a/chrome/common/extensions/api/file_browser_private.json b/chrome/common/extensions/api/file_browser_private.json
index e5b15ef..087224e 100644
--- a/chrome/common/extensions/api/file_browser_private.json
+++ b/chrome/common/extensions/api/file_browser_private.json
@@ -837,7 +837,7 @@
"name": "callback",
"type": "function",
"optional": true,
- "description": "Completion callback. chrome.extension.lastError will be set if there was an error.",
+ "description": "Completion callback. chrome.runtime.lastError will be set if there was an error.",
"parameters": []
}
]
@@ -884,7 +884,7 @@
"name": "callback",
"type": "function",
"optional": true,
- "description": "Completion callback. chrome.extension.lastError will be set if there was an error.",
+ "description": "Completion callback. chrome.runtime.lastError will be set if there was an error.",
"parameters": []
}
]
diff --git a/chrome/common/extensions/api/input_ime.json b/chrome/common/extensions/api/input_ime.json
index ae99ab5..939408b 100644
--- a/chrome/common/extensions/api/input_ime.json
+++ b/chrome/common/extensions/api/input_ime.json
@@ -91,7 +91,7 @@
"type": "function",
"name": "callback",
"optional": true,
- "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.extension.lastError is set.",
+ "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.",
"parameters": [
{
"name": "success",
@@ -120,7 +120,7 @@
"type": "function",
"name": "callback",
"optional": true,
- "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.extension.lastError is set.",
+ "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.",
"parameters": [
{
"name": "success",
@@ -153,7 +153,7 @@
"type": "function",
"name": "callback",
"optional": true,
- "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.extension.lastError is set.",
+ "description": "Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.",
"parameters": [
{
"name": "success",
diff --git a/chrome/common/extensions/api/tts.json b/chrome/common/extensions/api/tts.json
index 601edbf..3b2abf2 100644
--- a/chrome/common/extensions/api/tts.json
+++ b/chrome/common/extensions/api/tts.json
@@ -169,7 +169,7 @@
"type": "function",
"name": "callback",
"optional": true,
- "description": "Called right away, before speech finishes. Check chrome.extension.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback.",
+ "description": "Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback.",
"parameters": []
}
]
diff --git a/chrome/common/extensions/api/webstore_private.json b/chrome/common/extensions/api/webstore_private.json
index c128edc..49e10e4 100644
--- a/chrome/common/extensions/api/webstore_private.json
+++ b/chrome/common/extensions/api/webstore_private.json
@@ -56,7 +56,7 @@
{
"name": "callback",
"type": "function",
- "description": "Called when the install process completes. Upon failures, chrome.extension.lastError will be set to 'user_canceled' or 'unknown_error'.",
+ "description": "Called when the install process completes. Upon failures, chrome.runtime.lastError will be set to 'user_canceled' or 'unknown_error'.",
"optional": "true",
"parameters": []
}