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": "declarativeContent", | 7 "namespace": "declarativeContent", |
| 8 "description": "Use the <code>chrome.declarativeContent</code> API to take a ctions depending on the content of a page, without requiring permission to read the page's content.", | 8 "description": "Use the <code>chrome.declarativeContent</code> API to take a ctions depending on the content of a page, without requiring permission to read the page's content.", |
| 9 "types": [ | 9 "types": [ |
| 10 { | 10 { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 "type": "object", | 57 "type": "object", |
| 58 "properties": { | 58 "properties": { |
| 59 "instanceType": { | 59 "instanceType": { |
| 60 "type": "string", "enum": ["declarativeContent.ShowPageAction"], | 60 "type": "string", "enum": ["declarativeContent.ShowPageAction"], |
| 61 "nodoc": true | 61 "nodoc": true |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 }, | 64 }, |
| 65 { | 65 { |
| 66 "id": "SetIcon", | 66 "id": "SetIcon", |
| 67 "description": "Declarative event action that sets the 19-<abbr title=\" device-independent pixel\">dip</abbr> square icon for the extension's $(ref:page Action page action) or $(ref:browserAction browser action) while the correspondi ng conditions are met. This action can be used without <a href=\"declare_permis sions.html#host-permissions\">host permissions</a>, but the extension must have page or browser action.<p>Exactly one of <code>imageData</code> or <code>path</ code> must be specified. Both are dictionaries mapping a number of pixels to an image representation. The image representation in <code>imageData</code> is an< a href=\"https://developer.mozilla.org/en-US/docs/Web/API/ImageData\">ImageData< /a> object, for example from a <code><canvas></code> element, while the image representation in <code>path</code> is the path to an image file relative to he extension's manifest. If <code>scale</code> screen pixels fit into a device-in dependent pixel, the <code>scale * 19</code> icon will be used. If that scale i s missing, the other image will be resized to the needed size.", | 67 "description": "Declarative event action that sets the n-<abbr title=\"d evice-independent pixel\">dip</abbr> square icon for the extension's $(ref:pageA ction page action) or $(ref:browserAction browser action) while the correspondin g conditions are met. This action can be used without <a href=\"declare_permiss ions.html#host-permissions\">host permissions</a>, but the extension must have page or browser action.<p>Exactly one of <code>imageData</code> or <code>path</c ode> must be specified. Both are dictionaries mapping a number of pixels to an image representation. The image representation in <code>imageData</code> is an<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/ImageData\">ImageData</ a> object, for example from a <code><canvas></code> element, while the image representation in <code>path</code> is the path to an image file relative to he extension's manifest. If <code>scale</code> screen pixels fit into a device-ind ependent pixel, the <code>scale * n</code> icon will be used. If that scale is missing, another image will be resized to the needed size.", |
| 68 "type": "object", | 68 "type": "object", |
| 69 "properties": { | 69 "properties": { |
| 70 "instanceType": { | 70 "instanceType": { |
| 71 "type": "string", "enum": ["declarativeContent.SetIcon"], | 71 "type": "string", "enum": ["declarativeContent.SetIcon"], |
| 72 "nodoc": true | 72 "nodoc": true |
| 73 }, | 73 }, |
| 74 "imageData": { | 74 "imageData": { |
| 75 "choices": [ | 75 "choices": [ |
| 76 { "$ref": "ImageDataType" }, | 76 { "$ref": "ImageDataType" }, |
| 77 { | 77 { |
| 78 "type": "object", | 78 "type": "object", |
| 79 "properties": { | 79 "additionalProperties": { "type": "any" } |
| 80 "19": {"$ref": "ImageDataType", "optional": true}, | |
| 81 "38": {"$ref": "ImageDataType", "optional": true} | |
| 82 } | |
| 83 } | 80 } |
| 84 ], | 81 ], |
| 85 "optional": true, | 82 "optional": true, |
| 86 "description": "Either an ImageData object or a dictionary {size -> ImageData} 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 the number of image pixels that fit into one screen space unit equals <code>scal e</code>, then image with size <code>scale</code> * 19 will be selected. Initial ly only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'" | 83 "description": "Either an ImageData object or a dictionary {size -> ImageData} 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 the number of image pixels that fit into one screen space unit equals <code>scal e</code>, then image with size <code>scale</code> * n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note th at 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}'" |
| 87 } | 84 } |
| 88 // TODO: "path": { | 85 // TODO: "path": { |
| 89 // "choices": [ | 86 // "choices": [ |
| 90 // { "type": "string" }, | 87 // { "type": "string" }, |
| 91 // { | 88 // { |
| 92 // "type": "object", | 89 // "type": "object", |
| 93 // "properties": { | 90 // "additionalProperties": { "type": "any" } |
| 94 // "19": {"type": "string", "optional": true}, | |
| 95 // "38": {"type": "string", "optional": true} | |
| 96 // } | |
| 97 // } | 91 // } |
| 98 // ], | 92 // ], |
| 99 // "optional": true, | 93 // "optional": true, |
| 100 // "description": "Either a relative image path or a 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 density. If the number of image pixels that fit into one screen space unit equa ls <code>scale</code>, then image with size <code>scale</code> * 19 will be sele cted. Initially only scales 1 and 2 will be supported. At least one image must b e specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'" | 94 // "description": "Either a relative image path or a 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 density. If the number of image pixels that fit into one screen space unit equa ls <code>scale</code>, then image with size <code>scale</code> * n will be selec ted, where n is the size of the icon in the UI. At least one image must be speci fied. Note that 'details.path = foo' is equivalent to 'details.imageData = {'16' : foo}'" |
|
varkha
2016/01/21 03:05:49
s/details.imageData/details.path ?
| |
| 101 // } | 95 // } |
| 102 } | 96 } |
| 103 }, | 97 }, |
| 104 { | 98 { |
| 105 "id": "RequestContentScript", | 99 "id": "RequestContentScript", |
| 106 "description": "Declarative event action that injects a content script. <p><b>WARNING:</b> This action is still experimental and is not supported on sta ble builds of Chrome.</p>", | 100 "description": "Declarative event action that injects a content script. <p><b>WARNING:</b> This action is still experimental and is not supported on sta ble builds of Chrome.</p>", |
| 107 "type": "object", | 101 "type": "object", |
| 108 "properties": { | 102 "properties": { |
| 109 "css": { | 103 "css": { |
| 110 "type": "array", | 104 "type": "array", |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 "actions": [ | 141 "actions": [ |
| 148 "declarativeContent.RequestContentScript", | 142 "declarativeContent.RequestContentScript", |
| 149 "declarativeContent.SetIcon", | 143 "declarativeContent.SetIcon", |
| 150 "declarativeContent.ShowPageAction" | 144 "declarativeContent.ShowPageAction" |
| 151 ] | 145 ] |
| 152 } | 146 } |
| 153 } | 147 } |
| 154 ] | 148 ] |
| 155 } | 149 } |
| 156 ] | 150 ] |
| OLD | NEW |