| 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; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Height of the window. (Deprecated; use 'bounds'.) | 48 // Height of the window. (Deprecated; use 'bounds'.) |
| 49 [nodoc] long? height; | 49 [nodoc] long? height; |
| 50 | 50 |
| 51 // X coordinate of the window. (Deprecated; use 'bounds'.) | 51 // X coordinate of the window. (Deprecated; use 'bounds'.) |
| 52 [nodoc] long? left; | 52 [nodoc] long? left; |
| 53 | 53 |
| 54 // Y coordinate of the window. (Deprecated; use 'bounds'.) | 54 // Y coordinate of the window. (Deprecated; use 'bounds'.) |
| 55 [nodoc] long? top; | 55 [nodoc] long? top; |
| 56 | 56 |
| 57 // Minimum width for the lifetime of the window. | 57 // Minimum width of the window. |
| 58 long? minWidth; | 58 long? minWidth; |
| 59 | 59 |
| 60 // Minimum height for the lifetime of the window. | 60 // Minimum height of the window. |
| 61 long? minHeight; | 61 long? minHeight; |
| 62 | 62 |
| 63 // Maximum width for the lifetime of the window. | 63 // Maximum width of the window. |
| 64 long? maxWidth; | 64 long? maxWidth; |
| 65 | 65 |
| 66 // Maximum height for the lifetime of the window. | 66 // Maximum height of the window. |
| 67 long? maxHeight; | 67 long? maxHeight; |
| 68 | 68 |
| 69 // Type of window to create. | 69 // Type of window to create. |
| 70 [nodoc] WindowType? type; | 70 [nodoc] WindowType? type; |
| 71 | 71 |
| 72 // Frame type: <code>none</code> or <code>chrome</code> (defaults to | 72 // Frame type: <code>none</code> or <code>chrome</code> (defaults to |
| 73 // <code>chrome</code>). For <code>none</code>, the | 73 // <code>chrome</code>). For <code>none</code>, the |
| 74 // <code>-webkit-app-region</code> CSS property can be used to apply | 74 // <code>-webkit-app-region</code> CSS property can be used to apply |
| 75 // draggability to the app's window. <code>-webkit-app-region: drag</code> | 75 // draggability to the app's window. <code>-webkit-app-region: drag</code> |
| 76 // can be used to mark regions draggable. <code>no-drag</code> can be used | 76 // can be used to mark regions draggable. <code>no-drag</code> can be used |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 // Hide the window. Does nothing if the window is already hidden. | 168 // Hide the window. Does nothing if the window is already hidden. |
| 169 static void hide(); | 169 static void hide(); |
| 170 | 170 |
| 171 // Get the window's bounds as a $ref:Bounds object. | 171 // Get the window's bounds as a $ref:Bounds object. |
| 172 [nocompile] static Bounds getBounds(); | 172 [nocompile] static Bounds getBounds(); |
| 173 | 173 |
| 174 // Set the window's bounds. | 174 // Set the window's bounds. |
| 175 static void setBounds(Bounds bounds); | 175 static void setBounds(Bounds bounds); |
| 176 | 176 |
| 177 // Get the current minimum width of the window. Returns |undefined| if there |
| 178 // is no minimum. |
| 179 [nocompile] static long getMinWidth(); |
| 180 |
| 181 // Get the current minimum height of the window. Returns |undefined| if |
| 182 // there is no minimum. |
| 183 [nocompile] static long getMinHeight(); |
| 184 |
| 185 // Get the current maximum width of the window. Returns |undefined| if there |
| 186 // is no maximum. |
| 187 [nocompile] static long getMaxWidth(); |
| 188 |
| 189 // Get the current maximum height of the window. Returns |undefined| if |
| 190 // there is no maximum. |
| 191 [nocompile] static long getMaxHeight(); |
| 192 |
| 193 // Set the current minimum width of the window. Set to |null| to remove the |
| 194 // constraint. |
| 195 static void setMinWidth(optional long minWidth); |
| 196 |
| 197 // Set the current minimum height of the window. Set to |null| to remove the |
| 198 // constraint. |
| 199 static void setMinHeight(optional long minHeight); |
| 200 |
| 201 // Set the current maximum width of the window. Set to |null| to remove the |
| 202 // constraint. |
| 203 static void setMaxWidth(optional long maxWidth); |
| 204 |
| 205 // Set the current maximum height of the window. Set to |null| to remove the |
| 206 // constraint. |
| 207 static void setMaxHeight(optional long maxHeight); |
| 208 |
| 177 // Set the app icon for the window (experimental). | 209 // Set the app icon for the window (experimental). |
| 178 // Currently this is only being implemented on Ash. | 210 // Currently this is only being implemented on Ash. |
| 179 // TODO(stevenjb): Investigate implementing this on Windows and OSX. | 211 // TODO(stevenjb): Investigate implementing this on Windows and OSX. |
| 180 [nodoc] static void setIcon(DOMString icon_url); | 212 [nodoc] static void setIcon(DOMString icon_url); |
| 181 | 213 |
| 182 // Is the window always on top? | 214 // Is the window always on top? |
| 183 // Currently available in the Dev channel only. | 215 // Currently available in the Dev channel only. |
| 184 static boolean isAlwaysOnTop(); | 216 static boolean isAlwaysOnTop(); |
| 185 | 217 |
| 186 // Set whether the window should stay above most other windows. | 218 // Set whether the window should stay above most other windows. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // Fired when the window is maximized. | 267 // Fired when the window is maximized. |
| 236 [nocompile] static void onMaximized(); | 268 [nocompile] static void onMaximized(); |
| 237 | 269 |
| 238 // Fired when the window is minimized. | 270 // Fired when the window is minimized. |
| 239 [nocompile] static void onMinimized(); | 271 [nocompile] static void onMinimized(); |
| 240 | 272 |
| 241 // Fired when the window is restored from being minimized or maximized. | 273 // Fired when the window is restored from being minimized or maximized. |
| 242 [nocompile] static void onRestored(); | 274 [nocompile] static void onRestored(); |
| 243 }; | 275 }; |
| 244 }; | 276 }; |
| OLD | NEW |