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 // TODO(benwells): document this once we are happy with it. |
| 17 [nodoc] dictionary FrameOptions { |
| 18 DOMString? type; |
| 19 DOMString? color; |
| 20 }; |
| 21 |
16 // State of a window: normal, fullscreen, maximized, minimized. | 22 // State of a window: normal, fullscreen, maximized, minimized. |
17 enum State { normal, fullscreen, maximized, minimized }; | 23 enum State { normal, fullscreen, maximized, minimized }; |
18 | 24 |
19 // 'shell' is the default window type. 'panel' is managed by the OS | 25 // 'shell' is the default window type. 'panel' is managed by the OS |
20 // (Currently experimental, Ash only). | 26 // (Currently experimental, Ash only). |
21 [nodoc] enum WindowType { shell, panel }; | 27 [nodoc] enum WindowType { shell, panel }; |
22 | 28 |
23 dictionary CreateWindowOptions { | 29 dictionary CreateWindowOptions { |
24 // Id to identify the window. This will be used to remember the size | 30 // 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 | 31 // and position of the window and restore that geometry when a window |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 [nodoc] WindowType? type; | 75 [nodoc] WindowType? type; |
70 | 76 |
71 // Frame type: <code>none</code> or <code>chrome</code> (defaults to | 77 // Frame type: <code>none</code> or <code>chrome</code> (defaults to |
72 // <code>chrome</code>). For <code>none</code>, the | 78 // <code>chrome</code>). For <code>none</code>, the |
73 // <code>-webkit-app-region</code> CSS property can be used to apply | 79 // <code>-webkit-app-region</code> CSS property can be used to apply |
74 // draggability to the app's window. <code>-webkit-app-region: drag</code> | 80 // draggability to the app's window. <code>-webkit-app-region: drag</code> |
75 // can be used to mark regions draggable. <code>no-drag</code> can be used | 81 // can be used to mark regions draggable. <code>no-drag</code> can be used |
76 // to disable this style on nested elements. | 82 // to disable this style on nested elements. |
77 DOMString? frame; | 83 DOMString? frame; |
78 | 84 |
| 85 // TODO(benwells): Fix the IDL parsing so this can be: |
| 86 // (DOMString or FrameOptions)? frame. |
| 87 [nodoc] FrameOptions? frameOptions; |
| 88 |
79 // Size and position of the content in the window (excluding the titlebar). | 89 // Size and position of the content in the window (excluding the titlebar). |
80 // If an id is also specified and a window with a matching id has been shown | 90 // If an id is also specified and a window with a matching id has been shown |
81 // before, the remembered bounds of the window will be used instead. | 91 // before, the remembered bounds of the window will be used instead. |
82 Bounds? bounds; | 92 Bounds? bounds; |
83 | 93 |
84 // Enable window background transparency. | 94 // Enable window background transparency. |
85 // Only supported in ash. Requires experimental API permission. | 95 // Only supported in ash. Requires experimental API permission. |
86 boolean? transparentBackground; | 96 boolean? transparentBackground; |
87 | 97 |
88 // The initial state of the window, allowing it to be created already | 98 // The initial state of the window, allowing it to be created already |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // TODO(benwells): Document this properly before going to stable. | 235 // TODO(benwells): Document this properly before going to stable. |
226 [nodoc] static void setBadgeIcon(DOMString iconUrl); | 236 [nodoc] static void setBadgeIcon(DOMString iconUrl); |
227 | 237 |
228 // Clear the current for the window. | 238 // Clear the current for the window. |
229 // TODO(benwells): Document this properly before going to stable. | 239 // TODO(benwells): Document this properly before going to stable. |
230 [nodoc] static void clearBadge(); | 240 [nodoc] static void clearBadge(); |
231 | 241 |
232 // Is the window always on top? | 242 // Is the window always on top? |
233 static boolean isAlwaysOnTop(); | 243 static boolean isAlwaysOnTop(); |
234 | 244 |
| 245 // Accessors for testing. |
| 246 [nodoc] boolean hasFrameColor; |
| 247 [nodoc] long frameColor; |
| 248 |
235 // Set whether the window should stay above most other windows. Requires the | 249 // Set whether the window should stay above most other windows. Requires the |
236 // <code>"alwaysOnTopWindows"</code> permission. | 250 // <code>"alwaysOnTopWindows"</code> permission. |
237 static void setAlwaysOnTop(boolean alwaysOnTop); | 251 static void setAlwaysOnTop(boolean alwaysOnTop); |
238 | 252 |
239 // The JavaScript 'window' object for the created child. | 253 // The JavaScript 'window' object for the created child. |
240 [instanceOf=Window] object contentWindow; | 254 [instanceOf=Window] object contentWindow; |
241 | 255 |
242 // The id the window was created with. | 256 // The id the window was created with. |
243 DOMString id; | 257 DOMString id; |
244 }; | 258 }; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 // Fired when the window is maximized. | 309 // Fired when the window is maximized. |
296 [nocompile] static void onMaximized(); | 310 [nocompile] static void onMaximized(); |
297 | 311 |
298 // Fired when the window is minimized. | 312 // Fired when the window is minimized. |
299 [nocompile] static void onMinimized(); | 313 [nocompile] static void onMinimized(); |
300 | 314 |
301 // Fired when the window is restored from being minimized or maximized. | 315 // Fired when the window is restored from being minimized or maximized. |
302 [nocompile] static void onRestored(); | 316 [nocompile] static void onRestored(); |
303 }; | 317 }; |
304 }; | 318 }; |
OLD | NEW |