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

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: rebase Created 8 years, 3 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> or the <b>i mageData</b> property must be specified.",
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",
84 "optional": true 92 "properties": {
93 "19": {"$ref": "ImageDataType", "optional": true},
94 "38": {"$ref": "ImageDataType", "optional": true}
95 }
96 }
97 ],
98 "optional": true,
99 "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictio nary, 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. Ini tially only scales 1 and 2 will be supported. At least one image must be specifi ed. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {' 19': foo}'"
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" },
89 "optional": true 104 {
105 "type": "object",
106 "properties": {
107 "19": {"type": "string", "optional": true},
108 "38": {"type": "string", "optional": true}
109 }
110 }
111 ],
112 "optional": true,
113 "description": "Either a relative image path or a dictionary {si ze -> 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 pix el density. If the number of image pixels that fit into one screen space unit eq uals <code>scale</code>, then image with size <code>scale</code> * 19 will be se lected. 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.imageDat a = {'19': foo}'"
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 },
99 { 123 {
(...skipping 58 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
« no previous file with comments | « chrome/common/extensions/api/browser_action.json ('k') | chrome/common/extensions/extension_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698