Chromium Code Reviews| OLD | NEW |
|---|---|
| 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": "browserAction", | 7 "namespace": "browserAction", |
| 8 "dependencies": [ "tabs" ], | 8 "dependencies": [ "tabs" ], |
| 9 "types": [ | 9 "types": [ |
| 10 { | 10 { |
| 11 "id": "ColorArray", | 11 "id": "ColorArray", |
| 12 "type": "array", | 12 "type": "array", |
| 13 "items": { | 13 "items": { |
| 14 "type": "integer", | 14 "type": "integer", |
| 15 "minimum": 0, | 15 "minimum": 0, |
| 16 "maximum": 255 | 16 "maximum": 255 |
| 17 }, | 17 }, |
| 18 "minItems": 4, | 18 "minItems": 4, |
| 19 "maxItems": 4 | 19 "maxItems": 4 |
| 20 }, | |
| 21 { | |
| 22 "id": "ImageDataType", | |
| 23 "type": "object", | |
| 24 "isInstanceOf": "ImageData", | |
| 25 "additionalProperties": { "type": "any" }, | |
| 26 "description": "Pixel data for an image. Must be an ImageData object (fo r example, from a <code>canvas</code> element)." | |
|
Jeffrey Yasskin
2012/08/21 20:10:38
Ok, we should document that here. Would you like t
tbarzic
2012/08/22 00:12:49
ok, I'll add something tomorrow.
tbarzic
2012/08/22 18:43:16
On second thought, I'm not too sure this is the be
| |
| 20 } | 27 } |
| 21 ], | 28 ], |
| 22 "functions": [ | 29 "functions": [ |
| 23 { | 30 { |
| 24 "name": "setTitle", | 31 "name": "setTitle", |
| 25 "type": "function", | 32 "type": "function", |
| 26 "description": "Sets the title of the browser action. This shows up in t he tooltip.", | 33 "description": "Sets the title of the browser action. This shows up in t he tooltip.", |
| 27 "parameters": [ | 34 "parameters": [ |
| 28 { | 35 { |
| 29 "name": "details", | 36 "name": "details", |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 "name": "result", | 73 "name": "result", |
| 67 "type": "string" | 74 "type": "string" |
| 68 } | 75 } |
| 69 ] | 76 ] |
| 70 } | 77 } |
| 71 ] | 78 ] |
| 72 }, | 79 }, |
| 73 { | 80 { |
| 74 "name": "setIcon", | 81 "name": "setIcon", |
| 75 "type": "function", | 82 "type": "function", |
| 76 "description": "Sets the icon for the browser action. The icon can be sp ecified either as the path to an image file or as the pixel data from a canvas e lement. Either the <b>path</b> or the <b>imageData</b> property must be specifie d.", | 83 "description": "Sets the icon for the browser action. The icon can be sp ecified either as the path to an image file or as the pixel data from a canvas e lement, or as dictionary of either one of those. Either the <b>path</b> or the < b>imageData</b> property must be specified.", |
| 77 "parameters": [ | 84 "parameters": [ |
| 78 { | 85 { |
| 79 "name": "details", | 86 "name": "details", |
| 80 "type": "object", | 87 "type": "object", |
| 81 "properties": { | 88 "properties": { |
| 82 "imageData": { | 89 "imageData": { |
| 83 "type": "object", | 90 "choices": [ |
| 84 "isInstanceOf": "ImageData", | 91 { "$ref": "ImageDataType" }, |
| 85 "additionalProperties": { "type": "any" }, | 92 { |
| 86 "description": "Pixel data for an image. Must be an ImageData ob ject (for example, from a <code>canvas</code> element).", | 93 "type": "object", |
| 94 "properties": { | |
| 95 "19": {"$ref": "ImageDataType", "optional": true}, | |
| 96 "38": {"$ref": "ImageDataType", "optional": true} | |
| 97 } | |
| 98 } | |
| 99 ], | |
| 100 "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
Great comment!
Nits: It would be nice to call out
tbarzic
2012/08/22 00:12:49
Done.
| |
| 87 "optional": true | 101 "optional": true |
| 88 }, | 102 }, |
| 89 "path": { | 103 "path": { |
| 90 "type": "string", | 104 "choices": [ |
| 91 "description": "Relative path to an image in the extension to sh ow in the browser action.", | 105 { "type": "string" }, |
| 106 { | |
| 107 "type": "object", | |
| 108 "properties": { | |
| 109 "19": {"type": "string", "optional": true}, | |
| 110 "38": {"type": "string", "optional": true} | |
| 111 } | |
| 112 } | |
| 113 ], | |
| 114 "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}'", | |
|
Jeffrey Yasskin
2012/08/21 20:10:38
Same nits as above.
tbarzic
2012/08/22 00:12:49
Done.
| |
| 92 "optional": true | 115 "optional": true |
| 93 }, | 116 }, |
| 94 "tabId": { | 117 "tabId": { |
| 95 "type": "integer", | 118 "type": "integer", |
| 96 "optional": true, | 119 "optional": true, |
| 97 "description": "Limits the change to when a particular tab is se lected. Automatically resets when the tab is closed." | 120 "description": "Limits the change to when a particular tab is se lected. Automatically resets when the tab is closed." |
| 98 } | 121 } |
| 99 } | 122 } |
| 100 }, | 123 }, |
| 101 { | 124 { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 "parameters": [ | 320 "parameters": [ |
| 298 { | 321 { |
| 299 "name": "tab", | 322 "name": "tab", |
| 300 "$ref": "tabs.Tab" | 323 "$ref": "tabs.Tab" |
| 301 } | 324 } |
| 302 ] | 325 ] |
| 303 } | 326 } |
| 304 ] | 327 ] |
| 305 } | 328 } |
| 306 ] | 329 ] |
| OLD | NEW |