| Index: chrome/common/extensions/api/page_action.json
|
| diff --git a/chrome/common/extensions/api/page_action.json b/chrome/common/extensions/api/page_action.json
|
| index 693bd6f8199f4d013b1e856ff5a92ed71f90740f..9530e8c8946daae8ea6854406ff39f52f4f9b45c 100644
|
| --- a/chrome/common/extensions/api/page_action.json
|
| +++ b/chrome/common/extensions/api/page_action.json
|
| @@ -6,7 +6,15 @@
|
| {
|
| "namespace": "pageAction",
|
| "dependencies": [ "tabs" ],
|
| - "types": [],
|
| + "types": [
|
| + {
|
| + "id": "ImageDataType",
|
| + "type": "object",
|
| + "isInstanceOf": "ImageData",
|
| + "additionalProperties": { "type": "any" },
|
| + "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."
|
| + }
|
| + ],
|
| "functions": [
|
| {
|
| "name": "show",
|
| @@ -69,7 +77,7 @@
|
| {
|
| "name": "setIcon",
|
| "type": "function",
|
| - "description": "Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
|
| + "description": "Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
|
| "parameters": [
|
| {
|
| "name": "details",
|
| @@ -77,16 +85,32 @@
|
| "properties": {
|
| "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
|
| "imageData": {
|
| - "type": "object",
|
| - "isInstanceOf": "ImageData",
|
| - "additionalProperties": { "type": "any" },
|
| - "description": "Pixel data for an image. Must be an ImageData object (for example, from a canvas element).",
|
| - "optional": true
|
| + "choices": [
|
| + { "$ref": "ImageDataType" },
|
| + {
|
| + "type": "object",
|
| + "properties": {
|
| + "19": {"$ref": "ImageDataType", "optional": true},
|
| + "38": {"$ref": "ImageDataType", "optional": true}
|
| + }
|
| + }
|
| + ],
|
| + "optional": true,
|
| + "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
|
| },
|
| "path": {
|
| - "type": "string",
|
| - "description": "Relative path to an image in the extension to show in the browser action.",
|
| - "optional": true
|
| + "choices": [
|
| + { "type": "string" },
|
| + {
|
| + "type": "object",
|
| + "properties": {
|
| + "19": {"type": "string", "optional": true},
|
| + "38": {"type": "string", "optional": true}
|
| + }
|
| + }
|
| + ],
|
| + "optional": true,
|
| + "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
|
| },
|
| "iconIndex": {
|
| "type": "integer",
|
|
|