| OLD | NEW |
| (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": "windows", |
| 8 "compiler_options": { |
| 9 "implemented_in": "chrome/browser/extensions/api/tabs/tabs_api.h" |
| 10 }, |
| 11 "dependencies": [ "tabs" ], |
| 12 "types": [ |
| 13 { |
| 14 "id": "Window", |
| 15 "type": "object", |
| 16 "properties": { |
| 17 "id": {"type": "integer", "optional": true, "minimum": 0, "description
": "The ID of the window. Window IDs are unique within a browser session. Under
some circumstances a Window may not be assigned an ID, for example when querying
closed windows from the $ref:sessionRestore API."}, |
| 18 "focused": {"type": "boolean", "description": "Whether the window is c
urrently the focused window."}, |
| 19 "top": {"type": "integer", "optional": true, "description": "The offse
t of the window from the top edge of the screen in pixels. Under some circumstan
ces a Window may not be assigned top property, for example when querying closed
windows from the $ref:sessionRestore API."}, |
| 20 "left": {"type": "integer", "optional": true, "description": "The offs
et of the window from the left edge of the screen in pixels. Under some circumst
ances a Window may not be assigned left property, for example when querying clos
ed windows from the $ref:sessionRestore API."}, |
| 21 "width": {"type": "integer", "optional": true, "description": "The wid
th of the window in pixels. Under some circumstances a Window may not be assigne
d width property, for example when querying closed windows from the $ref:session
Restore API."}, |
| 22 "height": {"type": "integer", "optional": true, "description": "The he
ight of the window in pixels. Under some circumstances a Window may not be assig
ned height property, for example when querying closed windows from the $ref:sess
ionRestore API."}, |
| 23 "tabs": {"type": "array", "items": { "$ref": "tabs.Tab" }, "optional":
true, "description": "Array of $ref:tabs.Tab objects representing the current t
abs in the window."}, |
| 24 "incognito": {"type": "boolean", "description": "Whether the window is
incognito."}, |
| 25 "type": { |
| 26 "type": "string", |
| 27 "optional": true, |
| 28 "description": "The type of browser window this is. Under some circu
mstances a Window may not be assigned type property, for example when querying c
losed windows from the $ref:sessionRestore API.", |
| 29 "enum": ["normal", "popup", "panel", "app"] |
| 30 }, |
| 31 "state": { |
| 32 "type": "string", |
| 33 "optional": true, |
| 34 "description": "The state of this browser window. Under some circums
tances a Window may not be assigned state property, for example when querying cl
osed windows from the $ref:sessionRestore API.", |
| 35 "enum": ["normal", "minimized", "maximized", "fullscreen"] |
| 36 }, |
| 37 "alwaysOnTop": {"type": "boolean", "description": "Whether the window
is set to be always on top."} |
| 38 } |
| 39 } |
| 40 ], |
| 41 "properties": { |
| 42 "WINDOW_ID_NONE": { |
| 43 "value": -1, |
| 44 "description": "The windowId value that represents the absence of a chro
me browser window." |
| 45 }, |
| 46 "WINDOW_ID_CURRENT": { |
| 47 "value": -2, |
| 48 "description": "The windowId value that represents the <a href='windows.
html#current-window'>current window</a>." |
| 49 } |
| 50 }, |
| 51 "functions": [ |
| 52 { |
| 53 "name": "get", |
| 54 "type": "function", |
| 55 "description": "Gets details about a window.", |
| 56 "parameters": [ |
| 57 {"type": "integer", "name": "windowId", "minimum": -2}, |
| 58 { |
| 59 "type": "object", |
| 60 "name": "getInfo", |
| 61 "optional": true, |
| 62 "description": "", |
| 63 "properties": { |
| 64 "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:tabs.Tab objects" } |
| 65 } |
| 66 }, |
| 67 { |
| 68 "type": "function", |
| 69 "name": "callback", |
| 70 "parameters": [ |
| 71 { |
| 72 "name": "window", "$ref": "Window" |
| 73 } |
| 74 ] |
| 75 } |
| 76 ] |
| 77 }, |
| 78 { |
| 79 "name": "getCurrent", |
| 80 "type": "function", |
| 81 "description": "Gets the <a href='#current-window'>current window</a>.", |
| 82 "parameters": [ |
| 83 { |
| 84 "type": "object", |
| 85 "name": "getInfo", |
| 86 "optional": true, |
| 87 "description": "", |
| 88 "properties": { |
| 89 "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:tabs.Tab objects" } |
| 90 } |
| 91 }, |
| 92 { |
| 93 "type": "function", |
| 94 "name": "callback", |
| 95 "parameters": [ |
| 96 { |
| 97 "name": "window", "$ref": "Window" |
| 98 } |
| 99 ] |
| 100 } |
| 101 ] |
| 102 }, |
| 103 { |
| 104 "name": "getLastFocused", |
| 105 "type": "function", |
| 106 "description": "Gets the window that was most recently focused — t
ypically the window 'on top'.", |
| 107 "parameters": [ |
| 108 { |
| 109 "type": "object", |
| 110 "name": "getInfo", |
| 111 "optional": true, |
| 112 "description": "", |
| 113 "properties": { |
| 114 "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:tabs.Tab objects" } |
| 115 } |
| 116 }, |
| 117 { |
| 118 "type": "function", |
| 119 "name": "callback", |
| 120 "parameters": [ |
| 121 { |
| 122 "name": "window", "$ref": "Window" |
| 123 } |
| 124 ] |
| 125 } |
| 126 ] |
| 127 }, |
| 128 { |
| 129 "name": "getAll", |
| 130 "type": "function", |
| 131 "description": "Gets all windows.", |
| 132 "parameters": [ |
| 133 { |
| 134 "type": "object", |
| 135 "name": "getInfo", |
| 136 "optional": true, |
| 137 "description": "", |
| 138 "properties": { |
| 139 "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:tabs.Tab objects for that window." } |
| 140 } |
| 141 }, |
| 142 { |
| 143 "type": "function", |
| 144 "name": "callback", |
| 145 "parameters": [ |
| 146 { |
| 147 "name": "windows", "type": "array", "items": { "$ref": "Window"
} |
| 148 } |
| 149 ] |
| 150 } |
| 151 ] |
| 152 }, |
| 153 { |
| 154 "name": "create", |
| 155 "type": "function", |
| 156 "description": "Creates (opens) a new browser with any optional sizing,
position or default URL provided.", |
| 157 "parameters": [ |
| 158 { |
| 159 "type": "object", |
| 160 "name": "createData", |
| 161 "properties": { |
| 162 "url": { |
| 163 "type": "string", |
| 164 "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.", |
| 165 "optional": true, |
| 166 "choices": [ |
| 167 {"type": "string"}, |
| 168 {"type": "array", "items": {"type": "string"}} |
| 169 ] |
| 170 }, |
| 171 "tabId": {"type": "integer", "minimum": 0, "optional": true, "desc
ription": "The id of the tab for which you want to adopt to the new window."}, |
| 172 "left": {"type": "integer", "optional": true, "description": "The
number of pixels to position the new window from the left edge of the screen. If
not specified, the new window is offset naturally from the last focused window.
This value is ignored for panels."}, |
| 173 "top": {"type": "integer", "optional": true, "description": "The n
umber of pixels to position the new window from the top edge of the screen. If n
ot specified, the new window is offset naturally from the last focused window. T
his value is ignored for panels."}, |
| 174 "width": {"type": "integer", "minimum": 0, "optional": true, "desc
ription": "The width in pixels of the new window. If not specified defaults to a
natural width."}, |
| 175 "height": {"type": "integer", "minimum": 0, "optional": true, "des
cription": "The height in pixels of the new window. If not specified defaults to
a natural height."}, |
| 176 "focused": {"type": "boolean", "optional": true, "description": "I
f true, opens an active window. If false, opens an inactive window."}, |
| 177 "incognito": {"type": "boolean", "optional": true, "description":
"Whether the new window should be an incognito window."}, |
| 178 "type": { |
| 179 "type": "string", |
| 180 "optional": true, |
| 181 "description": "Specifies what type of browser window to create.
The 'panel' and 'detached_panel' types create a popup unless the '--enable-pane
ls' flag is set.", |
| 182 "enum": ["normal", "popup", "panel", "detached_panel"] |
| 183 } |
| 184 }, |
| 185 "optional": true |
| 186 }, |
| 187 { |
| 188 "type": "function", |
| 189 "name": "callback", |
| 190 "optional": true, |
| 191 "parameters": [ |
| 192 { |
| 193 "name": "window", "$ref": "Window", "description": "Contains det
ails about the created window.", |
| 194 "optional": true |
| 195 } |
| 196 ] |
| 197 } |
| 198 ] |
| 199 }, |
| 200 { |
| 201 "name": "update", |
| 202 "type": "function", |
| 203 "description": "Updates the properties of a window. Specify only the pro
perties that you want to change; unspecified properties will be left unchanged."
, |
| 204 "parameters": [ |
| 205 {"type": "integer", "name": "windowId", "minimum": -2}, |
| 206 { |
| 207 "type": "object", |
| 208 "name": "updateInfo", |
| 209 "properties": { |
| 210 "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."}, |
| 211 "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."}, |
| 212 "width": {"type": "integer", "minimum": 0, "optional": true, "desc
ription": "The width to resize the window to in pixels. This value is ignored fo
r panels."}, |
| 213 "height": {"type": "integer", "minimum": 0, "optional": true, "des
cription": "The height to resize the window to in pixels. This value is ignored
for panels."}, |
| 214 "focused": {"type": "boolean", "optional": true, "description": "I
f true, brings the window to the front. If false, brings the next window in the
z-order to the front."}, |
| 215 "drawAttention": {"type": "boolean", "optional": true, "descriptio
n": "If true, causes the window to be displayed in a manner that draws the user'
s attention to the window, without changing the focused window. The effect lasts
until the user changes focus to the window. This option has no effect if the wi
ndow already has focus. Set to false to cancel a previous draw attention request
."}, |
| 216 "state": { |
| 217 "type": "string", |
| 218 "optional": true, |
| 219 "description": "The new state of the window. The 'minimized', 'm
aximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width'
or 'height'.", |
| 220 "enum": ["normal", "minimized", "maximized", "fullscreen"] |
| 221 } |
| 222 } |
| 223 }, |
| 224 { |
| 225 "type": "function", |
| 226 "name": "callback", |
| 227 "optional": true, |
| 228 "parameters": [ |
| 229 { |
| 230 "name": "window", "$ref": "Window" |
| 231 } |
| 232 ] |
| 233 } |
| 234 ] |
| 235 }, |
| 236 { |
| 237 "name": "remove", |
| 238 "type": "function", |
| 239 "description": "Removes (closes) a window, and all the tabs inside it.", |
| 240 "parameters": [ |
| 241 {"type": "integer", "name": "windowId", "minimum": 0}, |
| 242 {"type": "function", "name": "callback", "optional": true, "parameters
": []} |
| 243 ] |
| 244 } |
| 245 ], |
| 246 "events": [ |
| 247 { |
| 248 "name": "onCreated", |
| 249 "type": "function", |
| 250 "description": "Fired when a window is created.", |
| 251 "parameters": [ |
| 252 { |
| 253 "$ref": "Window", |
| 254 "name": "window", |
| 255 "description": "Details of the window that was created." |
| 256 } |
| 257 ] |
| 258 }, |
| 259 { |
| 260 "name": "onRemoved", |
| 261 "type": "function", |
| 262 "description": "Fired when a window is removed (closed).", |
| 263 "parameters": [ |
| 264 {"type": "integer", "name": "windowId", "minimum": 0, "description": "
ID of the removed window."} |
| 265 ] |
| 266 }, |
| 267 { |
| 268 "name": "onFocusChanged", |
| 269 "type": "function", |
| 270 "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.", |
| 271 "parameters": [ |
| 272 {"type": "integer", "name": "windowId", "minimum": -1, "description":
"ID of the newly focused window."} |
| 273 ] |
| 274 } |
| 275 ] |
| 276 } |
| 277 ] |
| OLD | NEW |