| 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 namespace app.window { | 5 namespace app.window { |
| 6 dictionary Bounds { | 6 dictionary Bounds { |
| 7 long? left; | 7 long? left; |
| 8 long? top; | 8 long? top; |
| 9 long? width; | 9 long? width; |
| 10 long? height; | 10 long? height; |
| 11 }; | 11 }; |
| 12 | 12 |
| 13 // State of a window: normal, fullscreen, maximized, minimized. |
| 14 enum State { normal, fullscreen, maximized, minimized }; |
| 15 |
| 13 // 'shell' is the default window type. 'panel' is managed by the OS | 16 // 'shell' is the default window type. 'panel' is managed by the OS |
| 14 // (Currently experimental, Ash only). | 17 // (Currently experimental, Ash only). |
| 15 [nodoc] enum WindowType { shell, panel }; | 18 [nodoc] enum WindowType { shell, panel }; |
| 16 | 19 |
| 17 dictionary CreateWindowOptions { | 20 dictionary CreateWindowOptions { |
| 18 // Id to identify the window. This will be used to remember the size | 21 // Id to identify the window. This will be used to remember the size |
| 19 // and position of the window and restore that geometry when a window | 22 // and position of the window and restore that geometry when a window |
| 20 // with the same id (and no explicit size or position) is later opened. | 23 // with the same id (and no explicit size or position) is later opened. |
| 21 DOMString? id; | 24 DOMString? id; |
| 22 | 25 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 71 |
| 69 // Size of the content in the window (excluding the titlebar). If specified | 72 // Size of the content in the window (excluding the titlebar). If specified |
| 70 // in addition to any of the deprecated left/top/width/height parameters, | 73 // in addition to any of the deprecated left/top/width/height parameters, |
| 71 // this field takes precedence. | 74 // this field takes precedence. |
| 72 Bounds? bounds; | 75 Bounds? bounds; |
| 73 | 76 |
| 74 // Enable window background transparency. | 77 // Enable window background transparency. |
| 75 // Only supported in ash. Requires experimental API permission. | 78 // Only supported in ash. Requires experimental API permission. |
| 76 boolean? transparentBackground; | 79 boolean? transparentBackground; |
| 77 | 80 |
| 81 // The initial state of the window, allowing it to be created already |
| 82 // fullscreen, maximized, or minimized. Defaults to 'normal'. |
| 83 State? state; |
| 84 |
| 78 // If true, the window will be created in a hidden state. Call show() on | 85 // If true, the window will be created in a hidden state. Call show() on |
| 79 // the window to show it once it has been created. Defaults to false. | 86 // the window to show it once it has been created. Defaults to false. |
| 80 boolean? hidden; | 87 boolean? hidden; |
| 81 | 88 |
| 82 // If true, the window will be resizable by the user. Defaults to true. | 89 // If true, the window will be resizable by the user. Defaults to true. |
| 83 boolean? resizable; | 90 boolean? resizable; |
| 84 | 91 |
| 85 // By default if you specify an id for the window, the window will only be | 92 // By default if you specify an id for the window, the window will only be |
| 86 // created if another window with the same id doesn't already exist. If a | 93 // created if another window with the same id doesn't already exist. If a |
| 87 // window with the same id already exists that window is activated instead. | 94 // window with the same id already exists that window is activated instead. |
| 88 // If you do want to create multiple windows with the same id, you can | 95 // If you do want to create multiple windows with the same id, you can |
| 89 // set this property to false. | 96 // set this property to false. |
| 90 boolean? singleton; | 97 boolean? singleton; |
| 91 }; | 98 }; |
| 92 | 99 |
| 93 callback CreateWindowCallback = | 100 callback CreateWindowCallback = |
| 94 void ([instanceOf=AppWindow] object created_window); | 101 void ([instanceOf=AppWindow] object created_window); |
| 95 | 102 |
| 96 dictionary AppWindow { | 103 dictionary AppWindow { |
| 97 // Focus the window. | 104 // Focus the window. |
| 98 static void focus(); | 105 static void focus(); |
| 99 | 106 |
| 107 // Fullscreens the window. |
| 108 static void fullscreen(); |
| 109 |
| 100 // Is the window fullscreen? | 110 // Is the window fullscreen? |
| 101 static boolean isFullscreen(); | 111 static boolean isFullscreen(); |
| 102 | 112 |
| 103 // Minimize the window. | 113 // Minimize the window. |
| 104 static void minimize(); | 114 static void minimize(); |
| 105 | 115 |
| 106 // Is the window minimized? | 116 // Is the window minimized? |
| 107 static boolean isMinimized(); | 117 static boolean isMinimized(); |
| 108 | 118 |
| 109 // Maximize the window. | 119 // Maximize the window. |
| 110 static void maximize(); | 120 static void maximize(); |
| 111 | 121 |
| 112 // Is the window maximized? | 122 // Is the window maximized? |
| 113 static boolean isMaximized(); | 123 static boolean isMaximized(); |
| 114 | 124 |
| 115 // Restore the window, exiting a maximized or minimized state. | 125 // Restore the window, exiting a maximized, minimized, or fullscreen state. |
| 116 static void restore(); | 126 static void restore(); |
| 117 | 127 |
| 118 // Move the window to the position (|left|, |top|). | 128 // Move the window to the position (|left|, |top|). |
| 119 static void moveTo(long left, long top); | 129 static void moveTo(long left, long top); |
| 120 | 130 |
| 121 // Resize the window to |width|x|height| pixels in size. | 131 // Resize the window to |width|x|height| pixels in size. |
| 122 static void resizeTo(long width, long height); | 132 static void resizeTo(long width, long height); |
| 123 | 133 |
| 124 // Draw attention to the window. | 134 // Draw attention to the window. |
| 125 static void drawAttention(); | 135 static void drawAttention(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // Fired when the window is maximized. | 213 // Fired when the window is maximized. |
| 204 [nocompile] static void onMaximized(); | 214 [nocompile] static void onMaximized(); |
| 205 | 215 |
| 206 // Fired when the window is minimized. | 216 // Fired when the window is minimized. |
| 207 [nocompile] static void onMinimized(); | 217 [nocompile] static void onMinimized(); |
| 208 | 218 |
| 209 // Fired when the window is restored from being minimized or maximized. | 219 // Fired when the window is restored from being minimized or maximized. |
| 210 [nocompile] static void onRestored(); | 220 [nocompile] static void onRestored(); |
| 211 }; | 221 }; |
| 212 }; | 222 }; |
| OLD | NEW |