| 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": "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 Loading... |
| 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. The dictionary should contain icon
s of sizes 19 and 38. Either the <b>path</b>, the <b>imageData</b>, the <b>pathS
et</b> or the <b>imageDataSet</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": { |
| 88 "$ref": "ImageDataType", |
| 89 "optional": true |
| 90 }, |
| 91 "imageDataSet": { |
| 80 "type": "object", | 92 "type": "object", |
| 81 "isInstanceOf": "ImageData", | 93 "description": "Data for icons of sizes 19 and 38. UI will decid
e which icon to used depending on screen's scale factor.", |
| 82 "additionalProperties": { "type": "any" }, | 94 "optional": true, |
| 83 "description": "Pixel data for an image. Must be an ImageData ob
ject (for example, from a canvas element).", | 95 "properties": { |
| 84 "optional": true | 96 "19": {"$ref": "ImageDataType"}, |
| 97 "38": {"$ref": "ImageDataType"} |
| 98 } |
| 85 }, | 99 }, |
| 86 "path": { | 100 "path": { |
| 87 "type": "string", | 101 "type": "string", |
| 88 "description": "Relative path to an image in the extension to sh
ow in the browser action.", | 102 "description": "Relative path to an image in the extension to sh
ow in the browser action.", |
| 89 "optional": true | 103 "optional": true |
| 90 }, | 104 }, |
| 105 "pathSet": { |
| 106 "type": "object", |
| 107 "description": "Paths to icons of sizes 19 and 38. UI will decid
e which icon to used depending on screens scale factor.", |
| 108 "optional": true, |
| 109 "properties": { |
| 110 "19": { |
| 111 "type": "string", |
| 112 "description": "Relative path to an image representation in
the extension to show in the browser action at 1x scale." |
| 113 }, |
| 114 "38": { |
| 115 "type": "string", |
| 116 "description": "Relative path to an image representation in
the extension to show in the browser action at 2x scale." |
| 117 } |
| 118 } |
| 119 }, |
| 91 "iconIndex": { | 120 "iconIndex": { |
| 92 "type": "integer", | 121 "type": "integer", |
| 93 "minimum": 0, | 122 "minimum": 0, |
| 94 "description": "<b>Deprecated.</b> The zero-based index into the
<b>icons</b> vector specified in the manifest.", | 123 "description": "<b>Deprecated.</b> The zero-based index into the
<b>icons</b> vector specified in the manifest.", |
| 95 "optional": true | 124 "optional": true |
| 96 } | 125 } |
| 97 } | 126 } |
| 98 }, | 127 }, |
| 99 { | 128 { |
| 100 "type": "function", | 129 "type": "function", |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 "parameters": [ | 187 "parameters": [ |
| 159 { | 188 { |
| 160 "name": "tab", | 189 "name": "tab", |
| 161 "$ref": "tabs.Tab" | 190 "$ref": "tabs.Tab" |
| 162 } | 191 } |
| 163 ] | 192 ] |
| 164 } | 193 } |
| 165 ] | 194 ] |
| 166 } | 195 } |
| 167 ] | 196 ] |
| OLD | NEW |