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

Side by Side Diff: chrome/common/extensions/api/contextMenus.json

Issue 10272021: Files generated by the JSON schema compiler are named incorrectly (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor changes Created 8 years, 7 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 [
6 {
7 "namespace": "contextMenus",
8 "dependencies": [ "tabs" ],
9 "types": [
10 {
11 "id": "OnClickData",
12 "type": "object",
13 "description": "Information sent when a context menu item is clicked.",
14 "properties": {
15 "menuItemId": {
16 "type": "integer",
17 "description": "The ID of the menu item that was clicked."
18 },
19 "parentMenuItemId": {
20 "type": "integer",
21 "optional": true,
22 "description": "The parent ID, if any, for the item clicked."
23 },
24 "mediaType": {
25 "type": "string",
26 "optional": true,
27 "description": "One of 'image', 'video', or 'audio' if the context m enu was activated on one of these types of elements."
28 },
29 "linkUrl": {
30 "type": "string",
31 "optional": true,
32 "description": "If the element is a link, the URL it points to."
33 },
34 "srcUrl": {
35 "type": "string",
36 "optional": true,
37 "description": "Will be present for elements with a 'src' URL."
38 },
39 "pageUrl": {
40 "type": "string",
41 "description": "The URL of the page where the menu item was clicked. "
42 },
43 "frameUrl": {
44 "type": "string",
45 "optional": true,
46 "description": " The URL of the frame of the element where the conte xt menu was clicked, if it was in a frame."
47 },
48 "selectionText": {
49 "type": "string",
50 "optional": true,
51 "description": "The text for the context selection, if any."
52 },
53 "editable": {
54 "type": "string",
55 "description": "A flag indicating whether the element is editable (t ext input, textarea, etc.)."
56 }
57 }
58 }
59 ],
60 "functions": [
61 {
62 "name": "create",
63 "type": "function",
64 "description": "Creates a new context menu item. Note that if an error o ccurs during creation, you may not find out until the creation callback fires (t he details will be in chrome.extension.lastError).",
65 "returns": {
66 "type": "integer",
67 "description": "The ID of the newly created item."
68 },
69 "parameters": [
70 {
71 "type": "object",
72 "name": "createProperties",
73 "properties": {
74 "type": {
75 "type": "string",
76 "enum": ["normal", "checkbox", "radio", "separator"],
77 "optional": true,
78 "description": "The type of menu item. Defaults to 'normal' if n ot specified."
79 },
80 "title": {
81 "type": "string",
82 "optional": true,
83 "description": "The text to be displayed in the item; this is <e m>required</em> unless <em>type</em> is 'separator'. When the context is 'select ion', you can use <code>%s</code> within the string to show the selected text. F or example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Tr anslate 'cool' to Pig Latin\"."
84 },
85 "checked": {
86 "type": "boolean",
87 "optional": true,
88 "description": "The initial state of a checkbox or radio item: t rue for selected and false for unselected. Only one radio item can be selected a t a time in a given group of radio items."
89 },
90 "contexts": {
91 "type": "array",
92 "items": {
93 "type": "string",
94 "enum": ["all", "page", "frame", "selection", "link", "editabl e", "image", "video", "audio"]
95 },
96 "minItems": 1,
97 "optional": true,
98 "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified."
99 },
100 "onclick": {
101 "type": "function",
102 "optional": true,
103 "description": "A function that will be called back when the men u item is clicked.",
104 "parameters": [
105 {
106 "name": "info",
107 "$ref": "OnClickData",
108 "description": "Information about the item clicked and the c ontext where the click happened."
109 },
110 {
111 "name": "tab",
112 "$ref": "tabs.Tab",
113 "description": "The details of the tab where the click took place."
114 }
115 ]
116 },
117 "parentId": {
118 "type": "integer",
119 "optional": true,
120 "description": "The ID of a parent menu item; this makes the ite m a child of a previously added item."
121 },
122 "documentUrlPatterns": {
123 "type": "array",
124 "items": {"type": "string"},
125 "optional": true,
126 "description": "Lets you restrict the item to apply only to docu ments whose URL matches one of the given patterns. (This applies to frames as we ll.) For details on the format of a pattern, see <a href='match_patterns.html'>M atch Patterns</a>."
127 },
128 "targetUrlPatterns": {
129 "type": "array",
130 "items": {"type": "string"},
131 "optional": true,
132 "description": "Similar to documentUrlPatterns, but lets you fil ter based on the src attribute of img/audio/video tags and the href of anchor ta gs."
133 },
134 "enabled": {
135 "type": "boolean",
136 "optional": true,
137 "description": "Whether this context menu item is enabled or dis abled. Defaults to true."
138 }
139 }
140 },
141 {
142 "type": "function",
143 "name": "callback",
144 "optional": true,
145 "description": "Called when the item has been created in the browser . If there were any problems creating the item, details will be available in chr ome.extension.lastError.",
146 "parameters": []
147 }
148 ]
149 },
150 {
151 "name": "update",
152 "type": "function",
153 "description": "Updates a previously created context menu item.",
154 "parameters": [
155 {
156 "type": "integer",
157 "name": "id",
158 "description": "The ID of the item to update."
159 },
160 {
161 "type": "object",
162 "name": "updateProperties",
163 "description": "The properties to update. Accepts the same values as the create function.",
164 "properties": {
165 "type": {
166 "type": "string",
167 "enum": ["normal", "checkbox", "radio", "separator"],
168 "optional": true
169 },
170 "title": {
171 "type": "string",
172 "optional": true
173 },
174 "checked": {
175 "type": "boolean",
176 "optional": true
177 },
178 "contexts": {
179 "type": "array",
180 "items": {
181 "type": "string",
182 "enum": ["all", "page", "frame", "selection", "link", "editabl e", "image", "video", "audio"]
183 },
184 "minItems": 1,
185 "optional": true
186 },
187 "onclick": {
188 "type": "function",
189 "optional": true
190 },
191 "parentId": {
192 "type": "integer",
193 "optional": true,
194 "description": "Note: You cannot change an item to be a child of one of its own descendants."
195 },
196 "documentUrlPatterns": {
197 "type": "array",
198 "items": {"type": "string"},
199 "optional": true
200 },
201 "targetUrlPatterns": {
202 "type": "array",
203 "items": {"type": "string"},
204 "optional": true
205 },
206 "enabled": {
207 "type": "boolean",
208 "optional": true
209 }
210 }
211 },
212 {
213 "type": "function",
214 "name": "callback",
215 "optional": true,
216 "parameters": [],
217 "description": "Called when the context menu has been updated."
218 }
219 ]
220 },
221 {
222 "name": "remove",
223 "type": "function",
224 "description": "Removes a context menu item.",
225 "parameters": [
226 {
227 "type": "integer",
228 "name": "menuItemId",
229 "description": "The ID of the context menu item to remove."
230 },
231 {
232 "type": "function",
233 "name": "callback",
234 "optional": true,
235 "parameters": [],
236 "description": "Called when the context menu has been removed."
237 }
238 ]
239 },
240 {
241 "name": "removeAll",
242 "type": "function",
243 "description": "Removes all context menu items added by this extension." ,
244 "parameters": [
245 {
246 "type": "function",
247 "name": "callback",
248 "optional": true,
249 "parameters": [],
250 "description": "Called when removal is complete."
251 }
252 ]
253 }
254 ]
255 }
256 ]
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/content_settings.json ('k') | chrome/common/extensions/api/context_menus.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698