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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 [ 5 [
6 { 6 {
7 "namespace": "pageAction", 7 "namespace": "pageAction",
8 "dependencies": [ "tabs" ], 8 "dependencies": [ "tabs" ],
9 "types": [], 9 "types": [
10 {
11 "id": "ImageDataType",
12 "type": "object",
13 "isInstanceOf": "ImageData",
14 "additionalProperties": { "type": "any" },
15 "description": "Pixel data for an image. Must be an ImageData object (fo r example, from a <code>canvas</code> element)."
16 }
17 ],
10 "functions": [ 18 "functions": [
11 { 19 {
12 "name": "show", 20 "name": "show",
13 "type": "function", 21 "type": "function",
14 "description": "Shows the page action. The page action is shown whenever the tab is selected.", 22 "description": "Shows the page action. The page action is shown whenever the tab is selected.",
15 "parameters": [ 23 "parameters": [
16 {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."} 24 {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}
17 ] 25 ]
18 }, 26 },
19 { 27 {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 "name": "result", 70 "name": "result",
63 "type": "string" 71 "type": "string"
64 } 72 }
65 ] 73 ]
66 } 74 }
67 ] 75 ]
68 }, 76 },
69 { 77 {
70 "name": "setIcon", 78 "name": "setIcon",
71 "type": "function", 79 "type": "function",
72 "description": "Sets the icon for the page action. The icon can be speci fied either as the path to an image file or as the pixel data from a canvas elem ent. Either the <b>path</b> or the <b>imageData</b> property must be specified." , 80 "description": "Sets the icon for the page action. The icon can be speci fied either as the path to an image file or as the pixel data from a canvas elem ent, or as dictionary of either one of those. Either the <b>path</b>, the <b>ima geData</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.
73 "parameters": [ 81 "parameters": [
74 { 82 {
75 "name": "details", 83 "name": "details",
76 "type": "object", 84 "type": "object",
77 "properties": { 85 "properties": {
78 "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}, 86 "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
79 "imageData": { 87 "imageData": {
80 "type": "object", 88 "choices": [
81 "isInstanceOf": "ImageData", 89 { "$ref": "ImageDataType" },
82 "additionalProperties": { "type": "any" }, 90 {
83 "description": "Pixel data for an image. Must be an ImageData ob ject (for example, from a canvas element).", 91 "type": "object",
92 "properties": {
93 "19": {"$ref": "ImageDataType", "optional": true},
94 "38": {"$ref": "ImageDataType", "optional": true}
95 }
96 }
97 ],
98 "description": "Either ImageData object or dictionary {size -> I mageData} 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 n umber of image pixels that fit into one screen space unit equals scale, then ima ge 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.
84 "optional": true 99 "optional": true
85 }, 100 },
86 "path": { 101 "path": {
87 "type": "string", 102 "choices": [
88 "description": "Relative path to an image in the extension to sh ow in the browser action.", 103 { "type": "string" },
104 {
105 "type": "object",
106 "properties": {
107 "19": {"type": "string", "optional": true},
108 "38": {"type": "string", "optional": true}
109 }
110 }
111 ],
112 "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 d ensity. If number of image pixels that fit into one screen space unit equals sca le, then image with size scale * 19 will be selected. Initially only scales 1 an d 2 will be supported. At least one image should be specified. Note that 'detail s.path = foo' is equivalent to 'details.imageData = {'19': foo}'",
89 "optional": true 113 "optional": true
90 }, 114 },
91 "iconIndex": { 115 "iconIndex": {
92 "type": "integer", 116 "type": "integer",
93 "minimum": 0, 117 "minimum": 0,
94 "description": "<b>Deprecated.</b> The zero-based index into the <b>icons</b> vector specified in the manifest.", 118 "description": "<b>Deprecated.</b> The zero-based index into the <b>icons</b> vector specified in the manifest.",
95 "optional": true 119 "optional": true
96 } 120 }
97 } 121 }
98 }, 122 },
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 "parameters": [ 182 "parameters": [
159 { 183 {
160 "name": "tab", 184 "name": "tab",
161 "$ref": "tabs.Tab" 185 "$ref": "tabs.Tab"
162 } 186 }
163 ] 187 ]
164 } 188 }
165 ] 189 ]
166 } 190 }
167 ] 191 ]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698