| OLD | NEW |
| 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 // Use the <code>chrome.app.window</code> API to create windows. Windows | 5 // Use the <code>chrome.app.window</code> API to create windows. Windows |
| 6 // have an optional frame with title bar and size controls. They are not | 6 // have an optional frame with title bar and size controls. They are not |
| 7 // associated with any Chrome browser windows. | 7 // associated with any Chrome browser windows. |
| 8 namespace app.window { | 8 namespace app.window { |
| 9 dictionary Bounds { | 9 dictionary Bounds { |
| 10 long? left; | 10 long? left; |
| 11 long? top; | 11 long? top; |
| 12 long? width; | 12 long? width; |
| 13 long? height; | 13 long? height; |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 // State of a window: normal, fullscreen, maximized, minimized. | 16 // State of a window: normal, fullscreen, maximized, minimized. |
| 17 enum State { normal, fullscreen, maximized, minimized }; | 17 enum State { normal, fullscreen, maximized, minimized }; |
| 18 | 18 |
| 19 // 'shell' is the default window type. 'panel' is managed by the OS | 19 // 'shell' is the default window type. 'panel' is managed by the OS |
| 20 // (Currently experimental, Ash only). | 20 // (Currently experimental, Ash only). |
| 21 [nodoc] enum WindowType { shell, panel }; | 21 [nodoc] enum WindowType { shell, panel }; |
| 22 | 22 |
| 23 dictionary CreateWindowOptions { | 23 dictionary CreateWindowOptions { |
| 24 // Id to identify the window. This will be used to remember the size | 24 // Id to identify the window. This will be used to remember the size |
| 25 // and position of the window and restore that geometry when a window | 25 // and position of the window and restore that geometry when a window |
| 26 // with the same id is later opened. | 26 // with the same id is later opened. |
| 27 // If a window with a given id is created while another window with the same |
| 28 // id already exists, the currently opened window will be focused instead of |
| 29 // creating a new window. |
| 27 DOMString? id; | 30 DOMString? id; |
| 28 | 31 |
| 29 // Default width of the window. (Deprecated; regular bounds act like this | 32 // Default width of the window. (Deprecated; regular bounds act like this |
| 30 // now.) | 33 // now.) |
| 31 [nodoc] long? defaultWidth; | 34 [nodoc] long? defaultWidth; |
| 32 | 35 |
| 33 // Default height of the window. (Deprecated; regular bounds act like this | 36 // Default height of the window. (Deprecated; regular bounds act like this |
| 34 // now.) | 37 // now.) |
| 35 [nodoc] long? defaultHeight; | 38 [nodoc] long? defaultHeight; |
| 36 | 39 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 boolean? hidden; | 98 boolean? hidden; |
| 96 | 99 |
| 97 // If true, the window will be resizable by the user. Defaults to true. | 100 // If true, the window will be resizable by the user. Defaults to true. |
| 98 boolean? resizable; | 101 boolean? resizable; |
| 99 | 102 |
| 100 // By default if you specify an id for the window, the window will only be | 103 // By default if you specify an id for the window, the window will only be |
| 101 // created if another window with the same id doesn't already exist. If a | 104 // created if another window with the same id doesn't already exist. If a |
| 102 // window with the same id already exists that window is activated instead. | 105 // window with the same id already exists that window is activated instead. |
| 103 // If you do want to create multiple windows with the same id, you can | 106 // If you do want to create multiple windows with the same id, you can |
| 104 // set this property to false. | 107 // set this property to false. |
| 105 boolean? singleton; | 108 // (Deprecated; multiple windows with the same id is no longer supported.) |
| 109 [nodoc] boolean? singleton; |
| 106 | 110 |
| 107 // If true, the window will stay above most other windows. If there are | 111 // If true, the window will stay above most other windows. If there are |
| 108 // multiple windows of this kind, the currently focused window will be in | 112 // multiple windows of this kind, the currently focused window will be in |
| 109 // the foreground. Defaults to false. Call <code>setAlwaysOnTop()</code> on | 113 // the foreground. Defaults to false. Call <code>setAlwaysOnTop()</code> on |
| 110 // the window to change this property after creation. | 114 // the window to change this property after creation. |
| 111 boolean? alwaysOnTop; | 115 boolean? alwaysOnTop; |
| 112 }; | 116 }; |
| 113 | 117 |
| 114 // Called in the creating window (parent) before the load event is called in | 118 // Called in the creating window (parent) before the load event is called in |
| 115 // the created window (child). The parent can set fields or functions on the | 119 // the created window (child). The parent can set fields or functions on the |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // Fired when the window is maximized. | 268 // Fired when the window is maximized. |
| 265 [nocompile] static void onMaximized(); | 269 [nocompile] static void onMaximized(); |
| 266 | 270 |
| 267 // Fired when the window is minimized. | 271 // Fired when the window is minimized. |
| 268 [nocompile] static void onMinimized(); | 272 [nocompile] static void onMinimized(); |
| 269 | 273 |
| 270 // Fired when the window is restored from being minimized or maximized. | 274 // Fired when the window is restored from being minimized or maximized. |
| 271 [nocompile] static void onRestored(); | 275 [nocompile] static void onRestored(); |
| 272 }; | 276 }; |
| 273 }; | 277 }; |
| OLD | NEW |