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

Unified Diff: chrome/common/extensions/api/page_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/page_action.json
diff --git a/chrome/common/extensions/api/page_action.json b/chrome/common/extensions/api/page_action.json
index 693bd6f8199f4d013b1e856ff5a92ed71f90740f..61e1afd587e66db076a2c0ed635449c2df6f3af0 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. 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",
@@ -77,17 +85,38 @@
"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).",
+ "$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 screen's scale factor.",
+ "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."
+ }
+ }
+ },
"iconIndex": {
"type": "integer",
"minimum": 0,

Powered by Google App Engine
This is Rietveld 408576698