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

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

Issue 10855154: Update browserAction.setIcon and pageAction.setIcon for hidpi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 years, 4 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
Index: chrome/common/extensions/api/browser_action.json
diff --git a/chrome/common/extensions/api/browser_action.json b/chrome/common/extensions/api/browser_action.json
index 379bacb15f80e750aa7e8baa2b270334151c94cb..688dda2ffd31e635a9ab863c14bb8fcf63feef5e 100644
--- a/chrome/common/extensions/api/browser_action.json
+++ b/chrome/common/extensions/api/browser_action.json
@@ -17,6 +17,13 @@
},
"minItems": 4,
"maxItems": 4
+ },
+ {
+ "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)."
Jeffrey Yasskin 2012/08/17 23:20:28 How does Canvas.getImageDataHD() fit into all of t
tbarzic 2012/08/21 00:24:24 I don't think we support Canvas.getImageDataHD (se
}
],
"functions": [
@@ -73,24 +80,45 @@
{
"name": "setIcon",
"type": "function",
- "description": "Sets the icon for the browser 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 browser 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. The dictionary should contain icons of sizes 19 and 38. Either the <b>path</b>, the <b>imageData</b>, the <b>pathSet</b> or the <b>imageDataSet</b> property must be specified.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"imageData": {
- "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).",
+ "$ref": "ImageDataType",
"optional": true
},
+ "imageDataSet": {
+ "type": "object",
+ "description": "Data for icons of sizes 19 and 38. UI will decide which icon to used depending on screens scale factor.",
Jeffrey Yasskin 2012/08/17 23:20:28 "screen's" Also, "scale factor" isn't very descri
tbarzic 2012/08/21 00:22:07 I guess this is a bit better, but I feel there's s
+ "optional": true,
+ "properties": {
+ "19": {"$ref": "ImageDataType"},
+ "38": {"$ref": "ImageDataType"}
+ }
+ },
"path": {
"type": "string",
"description": "Relative path to an image in the extension to show in the browser action.",
"optional": true
},
+ "pathSet": {
+ "type": "object",
+ "description": "Paths to icons of sizes 19 and 38. UI will decide which icon to used depending on screens scale factor.",
+ "optional": true,
+ "properties": {
+ "19": {
+ "type": "string",
+ "description": "Relative path to an image representation in the extension to show in the browser action at 1x scale."
+ },
+ "38": {
+ "type": "string",
+ "description": "Relative path to an image representation in the extension to show in the browser action at 2x scale."
Jeffrey Yasskin 2012/08/17 23:20:28 "at 2x scale" won't make much sense when it shows
tbarzic 2012/08/21 00:22:07 removed description from here.
+ }
+ }
+ },
"tabId": {
"type": "integer",
"optional": true,

Powered by Google App Engine
This is Rietveld 408576698