15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)[
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  {
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    "namespace": "windows",
8eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch    "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.",
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    "compiler_options": {
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      "implemented_in": "chrome/browser/extensions/api/tabs/tabs_api.h"
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    },
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    "types": [
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "id": "Window",
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "object",
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "properties": {
175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)          "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."},
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          "focused": {"type": "boolean", "description": "Whether the window is currently the focused window."},
195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)          "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."},
205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)          "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."},
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)          "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."},
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)          "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."},
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)          "tabs": {"type": "array", "items": { "$ref": "tabs.Tab" }, "optional": true, "description": "Array of $(ref:tabs.Tab) objects representing the current tabs in the window."},
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          "incognito": {"type": "boolean", "description": "Whether the window is incognito."},
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          "type": {
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "string",
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)            "optional": true,
285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)            "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.",
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "enum": ["normal", "popup", "panel", "app"]
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          "state": {
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "string",
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)            "optional": true,
345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)            "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.",
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "enum": ["normal", "minimized", "maximized", "fullscreen"]
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
373551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)          "alwaysOnTop": {"type": "boolean", "description": "Whether the window is set to be always on top."},
385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)          "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API."}
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      }
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    ],
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    "properties": {
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      "WINDOW_ID_NONE": {
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "value": -1,
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "The windowId value that represents the absence of a chrome browser window."
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      "WINDOW_ID_CURRENT": {
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "value": -2,
49cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)        "description": "The windowId value that represents the <a href='windows#current-window'>current window</a>."
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      }
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    },
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    "functions": [
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "get",
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Gets details about a window.",
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {"type": "integer", "name": "windowId", "minimum": -2},
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "object",
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "getInfo",
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "optional": true,
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "description": "",
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "properties": {
655d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)              "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." }
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            }
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "function",
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "callback",
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "parameters": [
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              {
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "name": "window", "$ref": "Window"
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            ]
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          }
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "getCurrent",
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Gets the <a href='#current-window'>current window</a>.",
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "object",
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "getInfo",
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "optional": true,
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "description": "",
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "properties": {
905d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)              "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." }
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            }
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "function",
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "callback",
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "parameters": [
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              {
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "name": "window", "$ref": "Window"
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            ]
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          }
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "getLastFocused",
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Gets the window that was most recently focused &mdash; typically the window 'on top'.",
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "object",
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "getInfo",
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "optional": true,
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "description": "",
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "properties": {
1155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)              "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." }
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            }
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "function",
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "callback",
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "parameters": [
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              {
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "name": "window", "$ref": "Window"
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            ]
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          }
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "getAll",
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Gets all windows.",
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "object",
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "getInfo",
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "optional": true,
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "description": "",
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "properties": {
1405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)              "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." }
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            }
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "function",
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "callback",
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "parameters": [
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              {
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "name": "windows", "type": "array", "items": { "$ref": "Window" }
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            ]
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          }
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "create",
1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.",
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "object",
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "createData",
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "properties": {
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "url": {
164a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch                "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.",
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "optional": true,
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "choices": [
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                  {"type": "string"},
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                  {"type": "array", "items": {"type": "string"}}
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                ]
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              },
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "tabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The id of the tab for which you want to adopt to the new window."},
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "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."},
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "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."},
174c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)              "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."},
175c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)              "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."},
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "focused": {"type": "boolean", "optional": true, "description": "If true, opens an active window. If false, opens an inactive window."},
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "incognito": {"type": "boolean", "optional": true, "description": "Whether the new window should be an incognito window."},
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "type": {
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "type": "string",
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "optional": true,
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "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.",
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "enum": ["normal", "popup", "panel", "detached_panel"]
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            },
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "optional": true
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "function",
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "callback",
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "optional": true,
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "parameters": [
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              {
1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "name": "window", "$ref": "Window", "description": "Contains details about the created window.",
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "optional": true
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            ]
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          }
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "update",
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.",
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {"type": "integer", "name": "windowId", "minimum": -2},
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "object",
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "updateInfo",
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "properties": {
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "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."},
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "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."},
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "width": {"type": "integer", "minimum": 0, "optional": true, "description": "The width to resize the window to in pixels. This value is ignored for panels."},
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "height": {"type": "integer", "minimum": 0, "optional": true, "description": "The height to resize the window to in pixels. This value is ignored for panels."},
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "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."},
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "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."},
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              "state": {
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "type": "string",
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "optional": true,
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "description": "The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.",
2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "enum": ["normal", "minimized", "maximized", "fullscreen"]
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            }
2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          },
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "type": "function",
2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "callback",
2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "optional": true,
2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "parameters": [
2295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              {
2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                "name": "window", "$ref": "Window"
2315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)              }
2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            ]
2335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          }
2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "remove",
2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Removes (closes) a window, and all the tabs inside it.",
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {"type": "integer", "name": "windowId", "minimum": 0},
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {"type": "function", "name": "callback", "optional": true, "parameters": []}
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      }
2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    ],
2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    "events": [
2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "onCreated",
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Fired when a window is created.",
2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {
2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "$ref": "Window",
2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "name": "window",
2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            "description": "Details of the window that was created."
2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          }
2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "onRemoved",
2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "description": "Fired when a window is removed (closed).",
2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {"type": "integer", "name": "windowId", "minimum": 0, "description": "ID of the removed window."}
2655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      },
2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      {
2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "name": "onFocusChanged",
2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "type": "function",
2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "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.",
2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        "parameters": [
2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)          {"type": "integer", "name": "windowId", "minimum": -1, "description": "ID of the newly focused window."}
2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ]
2745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      }
2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    ]
2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  }
2775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)]
278