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

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

Issue 10025007: Convert tabs, windows, and extension APIs to feature system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blah Created 8 years, 8 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 | « chrome/common/extensions/api/tabs.json ('k') | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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": "windows", 7 "namespace": "windows",
8 "dependencies": [ "tabs" ], 8 "uses_feature_system": true,
9 "extension_types": ["extension", "packaged_app", "platform_app"],
10 // unblessed_extension and content_script are required because this module
11 // is needed by tabs.json, which is needed by extension.json.
12 "contexts": ["blessed_extension", "unblessed_extension", "content_script"],
13 "dependencies": ["api:tabs"],
9 "types": [ 14 "types": [
10 { 15 {
11 "id": "Window", 16 "id": "Window",
12 "type": "object", 17 "type": "object",
13 "properties": { 18 "properties": {
14 "id": {"type": "integer", "minimum": 0, "description": "The ID of the window. Window IDs are unique within a browser session."}, 19 "id": {"type": "integer", "minimum": 0, "description": "The ID of the window. Window IDs are unique within a browser session."},
15 "focused": {"type": "boolean", "description": "Whether the window is c urrently the focused window."}, 20 "focused": {"type": "boolean", "description": "Whether the window is c urrently the focused window."},
16 "top": {"type": "integer", "description": "The offset of the window fr om the top edge of the screen in pixels."}, 21 "top": {"type": "integer", "description": "The offset of the window fr om the top edge of the screen in pixels."},
17 "left": {"type": "integer", "description": "The offset of the window f rom the left edge of the screen in pixels."}, 22 "left": {"type": "integer", "description": "The offset of the window f rom the left edge of the screen in pixels."},
18 "width": {"type": "integer", "description": "The width of the window i n pixels."}, 23 "width": {"type": "integer", "description": "The width of the window i n pixels."},
(...skipping 22 matching lines...) Expand all
41 }, 46 },
42 "WINDOW_ID_CURRENT": { 47 "WINDOW_ID_CURRENT": {
43 "type": "integer", 48 "type": "integer",
44 "value": "-2", 49 "value": "-2",
45 "description": "The windowId value that represents the <a href='windows. html#current-window'>current window</a>." 50 "description": "The windowId value that represents the <a href='windows. html#current-window'>current window</a>."
46 } 51 }
47 }, 52 },
48 "functions": [ 53 "functions": [
49 { 54 {
50 "name": "get", 55 "name": "get",
56 "contexts": ["blessed_extension"],
57 "dependencies": ["permission:tabs"],
51 "type": "function", 58 "type": "function",
52 "description": "Gets details about a window.", 59 "description": "Gets details about a window.",
53 "parameters": [ 60 "parameters": [
54 {"type": "integer", "name": "windowId", "minimum": -2}, 61 {"type": "integer", "name": "windowId", "minimum": -2},
55 { 62 {
56 "type": "object", 63 "type": "object",
57 "name": "getInfo", 64 "name": "getInfo",
58 "optional": true, 65 "optional": true,
59 "description": "", 66 "description": "",
60 "properties": { 67 "properties": {
61 "populate": {"type": "boolean", "optional": true, "description": " If true, the window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects" } 68 "populate": {"type": "boolean", "optional": true, "description": " If true, the window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects" }
62 } 69 }
63 }, 70 },
64 { 71 {
65 "type": "function", 72 "type": "function",
66 "name": "callback", 73 "name": "callback",
67 "parameters": [ 74 "parameters": [
68 { 75 {
69 "name": "window", "$ref": "Window" 76 "name": "window", "$ref": "Window"
70 } 77 }
71 ] 78 ]
72 } 79 }
73 ] 80 ]
74 }, 81 },
75 { 82 {
76 "name": "getCurrent", 83 "name": "getCurrent",
84 "contexts": ["blessed_extension"],
85 "dependencies": ["permission:tabs"],
77 "type": "function", 86 "type": "function",
78 "description": "Gets the <a href='#current-window'>current window</a>.", 87 "description": "Gets the <a href='#current-window'>current window</a>.",
79 "parameters": [ 88 "parameters": [
80 { 89 {
81 "type": "object", 90 "type": "object",
82 "name": "getInfo", 91 "name": "getInfo",
83 "optional": true, 92 "optional": true,
84 "description": "", 93 "description": "",
85 "properties": { 94 "properties": {
86 "populate": {"type": "boolean", "optional": true, "description": " If true, the window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects" } 95 "populate": {"type": "boolean", "optional": true, "description": " If true, the window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects" }
87 } 96 }
88 }, 97 },
89 { 98 {
90 "type": "function", 99 "type": "function",
91 "name": "callback", 100 "name": "callback",
92 "parameters": [ 101 "parameters": [
93 { 102 {
94 "name": "window", "$ref": "Window" 103 "name": "window", "$ref": "Window"
95 } 104 }
96 ] 105 ]
97 } 106 }
98 ] 107 ]
99 }, 108 },
100 { 109 {
101 "name": "getLastFocused", 110 "name": "getLastFocused",
111 "contexts": ["blessed_extension"],
112 "dependencies": ["permission:tabs"],
102 "type": "function", 113 "type": "function",
103 "description": "Gets the window that was most recently focused &mdash; t ypically the window 'on top'.", 114 "description": "Gets the window that was most recently focused &mdash; t ypically the window 'on top'.",
104 "parameters": [ 115 "parameters": [
105 { 116 {
106 "type": "object", 117 "type": "object",
107 "name": "getInfo", 118 "name": "getInfo",
108 "optional": true, 119 "optional": true,
109 "description": "", 120 "description": "",
110 "properties": { 121 "properties": {
111 "populate": {"type": "boolean", "optional": true, "description": " If true, the window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects" } 122 "populate": {"type": "boolean", "optional": true, "description": " If true, the window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects" }
112 } 123 }
113 }, 124 },
114 { 125 {
115 "type": "function", 126 "type": "function",
116 "name": "callback", 127 "name": "callback",
117 "parameters": [ 128 "parameters": [
118 { 129 {
119 "name": "window", "$ref": "Window" 130 "name": "window", "$ref": "Window"
120 } 131 }
121 ] 132 ]
122 } 133 }
123 ] 134 ]
124 }, 135 },
125 { 136 {
126 "name": "getAll", 137 "name": "getAll",
138 "contexts": ["blessed_extension"],
139 "dependencies": ["permission:tabs"],
127 "type": "function", 140 "type": "function",
128 "description": "Gets all windows.", 141 "description": "Gets all windows.",
129 "parameters": [ 142 "parameters": [
130 { 143 {
131 "type": "object", 144 "type": "object",
132 "name": "getInfo", 145 "name": "getInfo",
133 "optional": true, 146 "optional": true,
134 "description": "", 147 "description": "",
135 "properties": { 148 "properties": {
136 "populate": {"type": "boolean", "optional": true, "description": " If true, each window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects for that window." } 149 "populate": {"type": "boolean", "optional": true, "description": " If true, each window object will have a <var>tabs</var> property that contains a list of the $ref:Tab objects for that window." }
137 } 150 }
138 }, 151 },
139 { 152 {
140 "type": "function", 153 "type": "function",
141 "name": "callback", 154 "name": "callback",
142 "parameters": [ 155 "parameters": [
143 { 156 {
144 "name": "windows", "type": "array", "items": { "$ref": "Window" } 157 "name": "windows", "type": "array", "items": { "$ref": "Window" }
145 } 158 }
146 ] 159 ]
147 } 160 }
148 ] 161 ]
149 }, 162 },
150 { 163 {
151 "name": "create", 164 "name": "create",
165 "contexts": ["blessed_extension"],
166 "dependencies": ["permission:tabs"],
152 "type": "function", 167 "type": "function",
153 "description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.", 168 "description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.",
154 "parameters": [ 169 "parameters": [
155 { 170 {
156 "type": "object", 171 "type": "object",
157 "name": "createData", 172 "name": "createData",
158 "properties": { 173 "properties": {
159 "url": { 174 "url": {
160 "type": "string", 175 "type": "string",
161 "description": "A URL or list of URLs to open as tabs in the win dow. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', n ot 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.", 176 "description": "A URL or list of URLs to open as tabs in the win dow. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', n ot 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
(...skipping 27 matching lines...) Expand all
189 { 204 {
190 "name": "window", "$ref": "Window", "description": "Contains det ails about the created window.", 205 "name": "window", "$ref": "Window", "description": "Contains det ails about the created window.",
191 "optional": true 206 "optional": true
192 } 207 }
193 ] 208 ]
194 } 209 }
195 ] 210 ]
196 }, 211 },
197 { 212 {
198 "name": "update", 213 "name": "update",
214 "contexts": ["blessed_extension"],
215 "dependencies": ["permission:tabs"],
199 "type": "function", 216 "type": "function",
200 "description": "Updates the properties of a window. Specify only the pro perties that you want to change; unspecified properties will be left unchanged." , 217 "description": "Updates the properties of a window. Specify only the pro perties that you want to change; unspecified properties will be left unchanged." ,
201 "parameters": [ 218 "parameters": [
202 {"type": "integer", "name": "windowId", "minimum": -2}, 219 {"type": "integer", "name": "windowId", "minimum": -2},
203 { 220 {
204 "type": "object", 221 "type": "object",
205 "name": "updateInfo", 222 "name": "updateInfo",
206 "properties": { 223 "properties": {
207 "left": {"type": "integer", "optional": true, "description": "The offset from the left edge of the screen to move the window to in pixels. This va lue is ignored for panels."}, 224 "left": {"type": "integer", "optional": true, "description": "The offset from the left edge of the screen to move the window to in pixels. This va lue is ignored for panels."},
208 "top": {"type": "integer", "optional": true, "description": "The o ffset from the top edge of the screen to move the window to in pixels. This valu e is ignored for panels."}, 225 "top": {"type": "integer", "optional": true, "description": "The o ffset from the top edge of the screen to move the window to in pixels. This valu e is ignored for panels."},
(...skipping 16 matching lines...) Expand all
225 "parameters": [ 242 "parameters": [
226 { 243 {
227 "name": "window", "$ref": "Window" 244 "name": "window", "$ref": "Window"
228 } 245 }
229 ] 246 ]
230 } 247 }
231 ] 248 ]
232 }, 249 },
233 { 250 {
234 "name": "remove", 251 "name": "remove",
252 "contexts": ["blessed_extension"],
253 "dependencies": ["permission:tabs"],
235 "type": "function", 254 "type": "function",
236 "description": "Removes (closes) a window, and all the tabs inside it.", 255 "description": "Removes (closes) a window, and all the tabs inside it.",
237 "parameters": [ 256 "parameters": [
238 {"type": "integer", "name": "windowId", "minimum": 0}, 257 {"type": "integer", "name": "windowId", "minimum": 0},
239 {"type": "function", "name": "callback", "optional": true, "parameters ": []} 258 {"type": "function", "name": "callback", "optional": true, "parameters ": []}
240 ] 259 ]
241 } 260 }
242 ], 261 ],
243 "events": [ 262 "events": [
244 { 263 {
245 "name": "onCreated", 264 "name": "onCreated",
265 "contexts": ["blessed_extension"],
266 "dependencies": ["permission:tabs"],
246 "type": "function", 267 "type": "function",
247 "description": "Fired when a window is created.", 268 "description": "Fired when a window is created.",
248 "parameters": [ 269 "parameters": [
249 { 270 {
250 "$ref": "Window", 271 "$ref": "Window",
251 "name": "window", 272 "name": "window",
252 "description": "Details of the window that was created." 273 "description": "Details of the window that was created."
253 } 274 }
254 ] 275 ]
255 }, 276 },
256 { 277 {
257 "name": "onRemoved", 278 "name": "onRemoved",
279 "contexts": ["blessed_extension"],
280 "dependencies": ["permission:tabs"],
258 "type": "function", 281 "type": "function",
259 "description": "Fired when a window is removed (closed).", 282 "description": "Fired when a window is removed (closed).",
260 "parameters": [ 283 "parameters": [
261 {"type": "integer", "name": "windowId", "minimum": 0, "description": " ID of the removed window."} 284 {"type": "integer", "name": "windowId", "minimum": 0, "description": " ID of the removed window."}
262 ] 285 ]
263 }, 286 },
264 { 287 {
265 "name": "onFocusChanged", 288 "name": "onFocusChanged",
289 "contexts": ["blessed_extension"],
290 "dependencies": ["permission:tabs"],
266 "type": "function", 291 "type": "function",
267 "description": "Fired when the currently focused window changes. Will be chrome.windows.WINDOW_ID_NONE if all chrome windows have lost focus. Note: On s ome Linux window managers, WINDOW_ID_NONE will always be sent immediately preced ing a switch from one chrome window to another.", 292 "description": "Fired when the currently focused window changes. Will be chrome.windows.WINDOW_ID_NONE if all chrome windows have lost focus. Note: On s ome Linux window managers, WINDOW_ID_NONE will always be sent immediately preced ing a switch from one chrome window to another.",
268 "parameters": [ 293 "parameters": [
269 {"type": "integer", "name": "windowId", "minimum": -1, "description": "ID of the newly focused window."} 294 {"type": "integer", "name": "windowId", "minimum": -1, "description": "ID of the newly focused window."}
270 ] 295 ]
271 } 296 }
272 ] 297 ]
273 } 298 }
274 ] 299 ]
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/tabs.json ('k') | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698