Chromium Code Reviews| 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..35425bba84d9ee6af33233e39411fe12ae65a48e 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>, the <b>imageData</b>, or <b>iconIndex</b>property must be specified.", |
|
Jeffrey Yasskin
2012/08/21 20:10:38
I believe it was intentional to omit iconIndex fro
tbarzic
2012/08/22 00:12:49
Done.
Aaron Boodman
2012/08/22 20:10:32
Yep.
|
| "parameters": [ |
| { |
| "name": "details", |
| @@ -77,15 +85,31 @@ |
| "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).", |
| + "choices": [ |
| + { "$ref": "ImageDataType" }, |
| + { |
| + "type": "object", |
| + "properties": { |
| + "19": {"$ref": "ImageDataType", "optional": true}, |
| + "38": {"$ref": "ImageDataType", "optional": true} |
| + } |
| + } |
| + ], |
| + "description": "Either ImageData object or 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 number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image should be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'", |
|
Jeffrey Yasskin
2012/08/21 20:10:38
Ditto from browser_action.json.
tbarzic
2012/08/22 00:12:49
Done.
|
| "optional": true |
| }, |
| "path": { |
| - "type": "string", |
| - "description": "Relative path to an image in the extension to show in the browser action.", |
| + "choices": [ |
| + { "type": "string" }, |
| + { |
| + "type": "object", |
| + "properties": { |
| + "19": {"type": "string", "optional": true}, |
| + "38": {"type": "string", "optional": true} |
| + } |
| + } |
| + ], |
| + "description": "Either relative image path or 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 number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image should be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'", |
| "optional": true |
| }, |
| "iconIndex": { |