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.
7 "namespace": "windows",
8 "description": "Use the <code>chrome.windows</code> API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.",
10 "implemented_in": "chrome/browser/extensions/api/tabs/tabs_api.h"
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 windows using the $(ref:sessions) API, in which case a session ID may be present."},
18 "focused": {"type": "boolean", "description": "Whether the window is currently the focused window."},
19 "top": {"type": "integer", "optional": true, "description": "The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the $(ref:sessions) API."},
20 "left": {"type": "integer", "optional": true, "description": "The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the $(ref:sessions) API."},
21 "width": {"type": "integer", "optional": true, "description": "The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the $(ref:sessions) API."},
22 "height": {"type": "integer", "optional": true, "description": "The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the $(ref:sessions) API."},
23 "tabs": {"type": "array", "items": { "$ref": "tabs.Tab" }, "optional": true, "description": "Array of $(ref:tabs.Tab) objects representing the current tabs in the window."},
24 "incognito": {"type": "boolean", "description": "Whether the window is incognito."},
28 "description": "The type of browser window this is. Under some circumstances a Window may not be assigned type property, for example when querying closed windows from the $(ref:sessions) API.",
29 "enum": ["normal", "popup", "panel", "app"]
34 "description": "The state of this browser window. Under some circumstances a Window may not be assigned state property, for example when querying closed windows from the $(ref:sessions) API.",
35 "enum": ["normal", "minimized", "maximized", "fullscreen"]
37 "alwaysOnTop": {"type": "boolean", "description": "Whether the window is set to be always on top."},
38 "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API."}
45 "description": "The windowId value that represents the absence of a chrome browser window."
47 "WINDOW_ID_CURRENT": {
49 "description": "The windowId value that represents the <a href='windows.html#current-window'>current window</a>."
56 "description": "Gets details about a window.",
58 {"type": "integer", "name": "windowId", "minimum": -2},
65 "populate": {"type": "boolean", "optional": true, "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." }
73 "name": "window", "$ref": "Window"
82 "description": "Gets the <a href='#current-window'>current window</a>.",
90 "populate": {"type": "boolean", "optional": true, "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." }
98 "name": "window", "$ref": "Window"
105 "name": "getLastFocused",
107 "description": "Gets the window that was most recently focused — typically the window 'on top'.",
115 "populate": {"type": "boolean", "optional": true, "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." }
123 "name": "window", "$ref": "Window"
132 "description": "Gets all windows.",
140 "populate": {"type": "boolean", "optional": true, "description": "If true, each $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects for that window. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." }
148 "name": "windows", "type": "array", "items": { "$ref": "Window" }
157 "description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.",
161 "name": "createData",
164 "description": "A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
168 {"type": "array", "items": {"type": "string"}}
171 "tabId": {"type": "integer", "minimum": 0, "optional": true, "description": "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 number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels."},
174 "width": {"type": "integer", "minimum": 0, "optional": true, "description": "The width in pixels of the new window, including the frame. If not specified defaults to a natural width."},
175 "height": {"type": "integer", "minimum": 0, "optional": true, "description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height."},
176 "focused": {"type": "boolean", "optional": true, "description": "If 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."},
181 "description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.",
182 "enum": ["normal", "popup", "panel", "detached_panel"]
193 "name": "window", "$ref": "Window", "description": "Contains details about the created window.",
203 "description": "Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.",
205 {"type": "integer", "name": "windowId", "minimum": -2},
208 "name": "updateInfo",
210 "left": {"type": "integer", "optional": true, "description": "The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels."},
211 "top": {"type": "integer", "optional": true, "description": "The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels."},
212 "width": {"type": "integer", "minimum": 0, "optional": true, "description": "The width to resize the window to in pixels. This value is ignored for panels."},
213 "height": {"type": "integer", "minimum": 0, "optional": true, "description": "The height to resize the window to in pixels. This value is ignored for panels."},
214 "focused": {"type": "boolean", "optional": true, "description": "If 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, "description": "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 window already has focus. Set to false to cancel a previous draw attention request."},
219 "description": "The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.",
220 "enum": ["normal", "minimized", "maximized", "fullscreen"]
230 "name": "window", "$ref": "Window"
239 "description": "Removes (closes) a window, and all the tabs inside it.",
241 {"type": "integer", "name": "windowId", "minimum": 0},
242 {"type": "function", "name": "callback", "optional": true, "parameters": []}
250 "description": "Fired when a window is created.",
255 "description": "Details of the window that was created."
262 "description": "Fired when a window is removed (closed).",
264 {"type": "integer", "name": "windowId", "minimum": 0, "description": "ID of the removed window."}
268 "name": "onFocusChanged",
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 some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one chrome window to another.",
272 {"type": "integer", "name": "windowId", "minimum": -1, "description": "ID of the newly focused window."}