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

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

Issue 264046: Update browser actions api to be like new design doc. (Closed)
Patch Set: rebase Created 11 years, 2 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
« no previous file with comments | « chrome/browser/views/browser_actions_container.cc ('k') | chrome/common/extensions/docs/browserAction.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/extension_api.json
diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json
index 5fe4d222e1798b9c1ad01abc3a5bc1b2923d708b..da803211b94418bce248e60da43b815db4e7db1d 100755
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -824,32 +824,43 @@
"types": [],
"functions": [
{
- "name": "setName",
+ "name": "setTitle",
"type": "function",
- "description": "Sets the text for the browser action. Shows up in the tooltip if the browser action is visible, and in the menu item.",
+ "description": "Sets the title of the browser action. Shows up in the tooltip if the browser action is visible, and in the menu item.",
"parameters": [
- {"type": "string", "name": "name", "description": "The string the browser action should display when moused over.", "optional": false}
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The string the browser action should display when moused over."
+ }
+ }
+ }
]
},
{
"name": "setIcon",
"type": "function",
- "description": "Sets the icon for the browser action. Can be up to about 22px square.",
+ "description": "Sets the icon for the browser action. The icon can be specified either as the index of one of the icons that was pre-specified in the manifest, or as the pixel data from a Canvas element. Either the iconIndex or the imageData property must be specified.",
"parameters": [
{
- "name": "iconId",
- "description": "An ImageData object from a canvas element, or a zero-based index into the |icons| vector specified in the manifest. This is useful to represent different browser action states. Example: A GMail checker could have a 'new email' icon and a 'no unread email' icon.",
- "choices": [
- {"type": "integer", "minimum": 0},
- {
- "type": "object",
- "properties": {
- "width": {"type": "integer", "description": "The image's width."},
- "height": {"type": "integer", "description": "The image's height."},
- "data": {"type": "any", "description": "The pixel data. Must be a CanvasPixelArray, with 32 bits per pixel and size equal to 4*width*height."}
- }
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "imageData": {
+ "type": "any",
+ "description": "Pixel data for an image. Must be an ImageData object (eg from a <code>canvas</code> element).",
+ "optional": true
+ },
+ "iconIndex": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "The zero-based index into the |icons| vector specified in the manifest.",
+ "optional": true
}
- ]
+ }
}
]
},
@@ -858,7 +869,16 @@
"type": "function",
"description": "Sets the badge text for the browser action. This is printed on top of the icon.",
"parameters": [
- {"type": "string", "name": "text", "description": "Any number of characters can be passed, but only about four can fit in the space."}
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "text": {
+ "type": "string",
+ "description": "Any number of characters can be passed, but only about four can fit in the space."
+ }
+ }
+ }
]
},
{
@@ -867,21 +887,37 @@
"description": "Sets the background color for the badge.",
"parameters": [
{
- "type": "array",
- "name": "color",
- "description": "An array of four integers in the range [0,255] that make up the ARGB color for the bakground of the badge.",
- "items": {
- "type": "integer",
- "minimum": 0,
- "maximum": 255
- },
- "minItems": 4,
- "maxItems": 4
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "array",
+ "description": "An array of four integers in the range [0,255] that make up the ARGB color for the bakground of the badge.",
+ "items": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255
+ },
+ "minItems": 4,
+ "maxItems": 4
+ }
+ }
}
]
}
],
"events": [
+ {
+ "name": "onClicked",
+ "type": "function",
+ "description": "Fired when a page action button is clicked.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab"
+ }
+ ]
+ }
]
},
{
« no previous file with comments | « chrome/browser/views/browser_actions_container.cc ('k') | chrome/common/extensions/docs/browserAction.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698