Chromium Code Reviews

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

Issue 10025007: Convert tabs, windows, and extension APIs to feature system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blah Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/common/extensions/api/extension_api_unittest.cc ('k') | chrome/common/extensions/api/windows.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/tabs.json
diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json
index ef78c2ebab4d17e1e02071be1e77ec7bdc76ccc1..03b1d478b8013b91445ac56748ad4cc288331a8f 100644
--- a/chrome/common/extensions/api/tabs.json
+++ b/chrome/common/extensions/api/tabs.json
@@ -5,7 +5,12 @@
[
{
"namespace": "tabs",
- "dependencies": [ "extension", "windows" ],
+ "uses_feature_system": true,
+ "extension_types": ["extension", "packaged_app", "platform_app"],
+ // unblessed_extension and content_script are required because this module
+ // is needed by extension.json.
+ "contexts": ["blessed_extension", "unblessed_extension", "content_script"],
+ "dependencies": ["api:windows", "api:extension"],
"types": [
{
"id": "Tab",
@@ -30,6 +35,8 @@
"functions": [
{
"name": "get",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Retrieves details about the specified tab.",
"parameters": [
@@ -49,6 +56,8 @@
},
{
"name": "getCurrent",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).",
"parameters": [
@@ -67,6 +76,7 @@
},
{
"name": "connect",
+ "contexts": ["blessed_extension"],
"nocompile": true,
"type": "function",
"description": "Connects to the content script(s) in the specified tab. The <a href='extension.html#event-onConnect'>chrome.extension.onConnect</a> event is fired in each content script running in the specified tab for the current extension. For more details, see <a href='content_scripts.html#messaging'>Content Script Messaging</a>.",
@@ -92,6 +102,7 @@
},
{
"name": "sendRequest",
+ "contexts": ["blessed_extension"],
"nodoc": true,
"nocompile": true,
"type": "function",
@@ -122,6 +133,7 @@
},
{
"name": "sendMessage",
+ "contexts": ["blessed_extension"],
"nocompile": true,
"type": "function",
"description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The <a href='extension.html#event-onMessage'>chrome.extension.onMessage</a> event is fired in each content script running in the specified tab for the current extension.",
@@ -151,6 +163,8 @@
},
{
"name": "getSelected",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"nodoc": true,
"type": "function",
"description": "Deprecated. Please use query({'active': true}). Gets the tab that is selected in the specified window.",
@@ -173,6 +187,8 @@
},
{
"name": "getAllInWindow",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"nodoc": true,
"description": "Deprecated. Please use query({'windowId': windowId}). Gets details about all tabs in the specified window.",
@@ -195,6 +211,7 @@
},
{
"name": "create",
+ "contexts": ["blessed_extension"],
"type": "function",
"description": "Creates a new tab. Note: This function can be used without requesting the 'tabs' permission in the manifest.",
"parameters": [
@@ -259,6 +276,8 @@
},
{
"name": "query",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.",
"parameters": [
@@ -344,6 +363,8 @@
},
{
"name": "highlight",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Highlights the given tabs.",
"parameters": [
@@ -380,6 +401,7 @@
},
{
"name": "update",
+ "contexts": ["blessed_extension"],
"type": "function",
"description": "Modifies the properties of a tab. Properties that are not specified in <var>updateProperties</var> are not modified. Note: This function can be used without requesting the 'tabs' permission in the manifest.",
"parameters": [
@@ -445,6 +467,8 @@
},
{
"name": "move",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === \"normal\") windows.",
"parameters": [
@@ -492,6 +516,8 @@
},
{
"name": "reload",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Reload a tab.",
"parameters": [
@@ -529,6 +555,8 @@
},
{
"name": "detectLanguage",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Detects the primary language of the content in a tab.",
"parameters": [
@@ -554,6 +582,8 @@
},
{
"name": "captureVisibleTab",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Captures the visible area of the currently active tab in the specified window. You must have <a href='manifest.html#permissions'>host permission</a> for the URL displayed by the tab.",
"parameters": [
@@ -594,6 +624,8 @@
},
{
"name": "executeScript",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Injects JavaScript code into a page. For details, see the <a href='content_scripts.html#pi'>programmatic injection</a> section of the content scripts doc.",
"parameters": [
@@ -619,6 +651,8 @@
},
{
"name": "insertCSS",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Injects CSS into a page. For details, see the <a href='content_scripts.html#pi'>programmatic injection</a> section of the content scripts doc.",
"parameters": [
@@ -646,6 +680,8 @@
"events": [
{
"name": "onCreated",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
"parameters": [
@@ -658,6 +694,8 @@
},
{
"name": "onUpdated",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Fired when a tab is updated.",
"parameters": [
@@ -693,6 +731,8 @@
},
{
"name": "onMoved",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see <a href='#event-onDetached'>onDetached</a>.",
"parameters": [
@@ -710,6 +750,8 @@
},
{
"name": "onSelectionChanged",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"nodoc": true,
"type": "function",
"description": "Deprecated. Please use onActivated.",
@@ -735,6 +777,8 @@
},
{
"name": "onActiveChanged",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"nodoc": true,
"type": "function",
"description": "Deprecated. Please use onActivated.",
@@ -760,6 +804,8 @@
},
{
"name": "onActivated",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
"parameters": [
@@ -783,6 +829,8 @@
},
{
"name": "onHighlightChanged",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"nodoc": true,
"description": "Deprecated. Please use onHighlighted.",
@@ -808,6 +856,8 @@
},
{
"name": "onHighlighted",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Fired when the highlighted or selected tabs in a window changes.",
"parameters": [
@@ -832,6 +882,8 @@
},
{
"name": "onDetached",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
"parameters": [
@@ -848,6 +900,8 @@
},
{
"name": "onAttached",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:tabs"],
"type": "function",
"description": "Fired when a tab is attached to a window, for example because it was moved between windows.",
"parameters": [
@@ -864,6 +918,7 @@
},
{
"name": "onRemoved",
+ "contexts": ["blessed_extension"],
"type": "function",
"description": "Fired when a tab is closed. Note: A listener can be registered for this event without requesting the 'tabs' permission in the manifest.",
"parameters": [
« no previous file with comments | « chrome/common/extensions/api/extension_api_unittest.cc ('k') | chrome/common/extensions/api/windows.json » ('j') | no next file with comments »

Powered by Google App Engine