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

Side by Side Diff: third_party/chrome/idl/context_menus.json

Issue 12261015: Import chrome idl into third_party (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« no previous file with comments | « third_party/chrome/idl/content_settings.json ('k') | third_party/chrome/idl/cookies.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "choices": [
17 { "type": "integer" },
18 { "type": "string" }
19 ],
20 "description": "The ID of the menu item that was clicked."
21 },
22 "parentMenuItemId": {
23 "choices": [
24 { "type": "integer" },
25 { "type": "string" }
26 ],
27 "optional": true,
28 "description": "The parent ID, if any, for the item clicked."
29 },
30 "mediaType": {
31 "type": "string",
32 "optional": true,
33 "description": "One of 'image', 'video', or 'audio' if the context m enu was activated on one of these types of elements."
34 },
35 "linkUrl": {
36 "type": "string",
37 "optional": true,
38 "description": "If the element is a link, the URL it points to."
39 },
40 "srcUrl": {
41 "type": "string",
42 "optional": true,
43 "description": "Will be present for elements with a 'src' URL."
44 },
45 "pageUrl": {
46 "type": "string",
47 "optional": true,
48 "description": "The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no cu rrent page, such as in a launcher context menu."
49 },
50 "frameUrl": {
51 "type": "string",
52 "optional": true,
53 "description": " The URL of the frame of the element where the conte xt menu was clicked, if it was in a frame."
54 },
55 "selectionText": {
56 "type": "string",
57 "optional": true,
58 "description": "The text for the context selection, if any."
59 },
60 "editable": {
61 "type": "boolean",
62 "description": "A flag indicating whether the element is editable (t ext input, textarea, etc.)."
63 },
64 "wasChecked": {
65 "type": "boolean",
66 "optional": true,
67 "description": "A flag indicating the state of a checkbox or radio i tem before it was clicked."
68 },
69 "checked": {
70 "type": "boolean",
71 "optional": true,
72 "description": "A flag indicating the state of a checkbox or radio i tem after it is clicked."
73 }
74 }
75 }
76 ],
77 "functions": [
78 {
79 "name": "create",
80 "type": "function",
81 "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.runtime.lastError).",
82 "returns": {
83 "choices": [
84 { "type": "integer" },
85 { "type": "string" }
86 ],
87 "description": "The ID of the newly created item."
88 },
89 "parameters": [
90 {
91 "type": "object",
92 "name": "createProperties",
93 "properties": {
94 "type": {
95 "type": "string",
96 "enum": ["normal", "checkbox", "radio", "separator"],
97 "optional": true,
98 "description": "The type of menu item. Defaults to 'normal' if n ot specified."
99 },
100 "id": {
101 "type": "string",
102 "optional": true,
103 "description": "The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension."
104 },
105 "title": {
106 "type": "string",
107 "optional": true,
108 "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\"."
109 },
110 "checked": {
111 "type": "boolean",
112 "optional": true,
113 "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."
114 },
115 "contexts": {
116 "type": "array",
117 "items": {
118 "type": "string",
119 "enum": ["all", "page", "frame", "selection", "link", "editabl e", "image", "video", "audio", "launcher"]
120 },
121 "minItems": 1,
122 "optional": true,
123 "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the c ombination of all other contexts except for 'launcher'. The 'launcher' context i s only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Differen t platforms might put limitations on what is actually supported in a launcher co ntext menu."
124 },
125 "onclick": {
126 "type": "function",
127 "optional": true,
128 "description": "A function that will be called back when the men u item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked.",
129 "parameters": [
130 {
131 "name": "info",
132 "$ref": "OnClickData",
133 "description": "Information about the item clicked and the c ontext where the click happened."
134 },
135 {
136 "name": "tab",
137 "$ref": "tabs.Tab",
138 "description": "The details of the tab where the click took place."
139 }
140 ]
141 },
142 "parentId": {
143 "choices": [
144 { "type": "integer" },
145 { "type": "string" }
146 ],
147 "optional": true,
148 "description": "The ID of a parent menu item; this makes the ite m a child of a previously added item."
149 },
150 "documentUrlPatterns": {
151 "type": "array",
152 "items": {"type": "string"},
153 "optional": true,
154 "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>."
155 },
156 "targetUrlPatterns": {
157 "type": "array",
158 "items": {"type": "string"},
159 "optional": true,
160 "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."
161 },
162 "enabled": {
163 "type": "boolean",
164 "optional": true,
165 "description": "Whether this context menu item is enabled or dis abled. Defaults to true."
166 }
167 }
168 },
169 {
170 "type": "function",
171 "name": "callback",
172 "optional": true,
173 "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.runtime.lastError.",
174 "parameters": []
175 }
176 ]
177 },
178 {
179 "name": "update",
180 "type": "function",
181 "description": "Updates a previously created context menu item.",
182 "parameters": [
183 {
184 "choices": [
185 { "type": "integer" },
186 { "type": "string" }
187 ],
188 "name": "id",
189 "description": "The ID of the item to update."
190 },
191 {
192 "type": "object",
193 "name": "updateProperties",
194 "description": "The properties to update. Accepts the same values as the create function.",
195 "properties": {
196 "type": {
197 "type": "string",
198 "enum": ["normal", "checkbox", "radio", "separator"],
199 "optional": true
200 },
201 "title": {
202 "type": "string",
203 "optional": true
204 },
205 "checked": {
206 "type": "boolean",
207 "optional": true
208 },
209 "contexts": {
210 "type": "array",
211 "items": {
212 "type": "string",
213 "enum": ["all", "page", "frame", "selection", "link", "editabl e", "image", "video", "audio", "launcher"]
214 },
215 "minItems": 1,
216 "optional": true
217 },
218 "onclick": {
219 "type": "function",
220 "optional": true
221 },
222 "parentId": {
223 "choices": [
224 { "type": "integer" },
225 { "type": "string" }
226 ],
227 "optional": true,
228 "description": "Note: You cannot change an item to be a child of one of its own descendants."
229 },
230 "documentUrlPatterns": {
231 "type": "array",
232 "items": {"type": "string"},
233 "optional": true
234 },
235 "targetUrlPatterns": {
236 "type": "array",
237 "items": {"type": "string"},
238 "optional": true
239 },
240 "enabled": {
241 "type": "boolean",
242 "optional": true
243 }
244 }
245 },
246 {
247 "type": "function",
248 "name": "callback",
249 "optional": true,
250 "parameters": [],
251 "description": "Called when the context menu has been updated."
252 }
253 ]
254 },
255 {
256 "name": "remove",
257 "type": "function",
258 "description": "Removes a context menu item.",
259 "parameters": [
260 {
261 "choices": [
262 { "type": "integer" },
263 { "type": "string" }
264 ],
265 "name": "menuItemId",
266 "description": "The ID of the context menu item to remove."
267 },
268 {
269 "type": "function",
270 "name": "callback",
271 "optional": true,
272 "parameters": [],
273 "description": "Called when the context menu has been removed."
274 }
275 ]
276 },
277 {
278 "name": "removeAll",
279 "type": "function",
280 "description": "Removes all context menu items added by this extension." ,
281 "parameters": [
282 {
283 "type": "function",
284 "name": "callback",
285 "optional": true,
286 "parameters": [],
287 "description": "Called when removal is complete."
288 }
289 ]
290 }
291 ],
292 "events": [
293 {
294 "name": "onClicked",
295 "type": "function",
296 "description": "Fired when a context menu item is clicked.",
297 "parameters": [
298 {
299 "name": "info",
300 "$ref": "OnClickData",
301 "description": "Information about the item clicked and the context w here the click happened."
302 },
303 {
304 "name": "tab",
305 "$ref": "tabs.Tab",
306 "description": "The details of the tab where the click took place. I f the click did not take place in a tab, this parameter will be missing.",
307 "optional": true
308 }
309 ]
310 }
311 ]
312 }
313 ]
OLDNEW
« no previous file with comments | « third_party/chrome/idl/content_settings.json ('k') | third_party/chrome/idl/cookies.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698