| 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 CreateWindowOptions { | 6 dictionary CreateWindowOptions { |
| 7 // Id to identify the window. This will be used to remember the size | 7 // Id to identify the window. This will be used to remember the size |
| 8 // and position of the window and restore that geometry when a window | 8 // and position of the window and restore that geometry when a window |
| 9 // with the same id (and no explicit size or position) is later opened. | 9 // with the same id (and no explicit size or position) is later opened. |
| 10 DOMString? id; | 10 DOMString? id; |
| 11 | 11 |
| 12 // Default width of the window. | 12 // Default width of the window. (Deprecated; regular bounds act like this |
| 13 long? defaultWidth; | 13 // now.) |
| 14 [nodoc] long? defaultWidth; |
| 14 | 15 |
| 15 // Default height of the window. | 16 // Default height of the window. (Deprecated; regular bounds act like this |
| 16 long? defaultHeight; | 17 // now.) |
| 18 [nodoc] long? defaultHeight; |
| 17 | 19 |
| 18 // Default X coordinate of the window. | 20 // Default X coordinate of the window. (Deprecated; regular bounds act like |
| 19 long? defaultLeft; | 21 // this now.) |
| 22 [nodoc] long? defaultLeft; |
| 20 | 23 |
| 21 // Default Y coordinate of the window. | 24 // Default Y coordinate of the window. (Deprecated; regular bounds act like |
| 22 long? defaultTop; | 25 // this now.) |
| 26 [nodoc] long? defaultTop; |
| 23 | 27 |
| 24 // Width of the window. (Deprecated; use 'bounds'.) | 28 // Width of the window. (Deprecated; use 'bounds'.) |
| 25 [nodoc] long? width; | 29 [nodoc] long? width; |
| 26 | 30 |
| 27 // Height of the window. (Deprecated; use 'bounds'.) | 31 // Height of the window. (Deprecated; use 'bounds'.) |
| 28 [nodoc] long? height; | 32 [nodoc] long? height; |
| 29 | 33 |
| 30 // X coordinate of the window. (Deprecated; use 'bounds'.) | 34 // X coordinate of the window. (Deprecated; use 'bounds'.) |
| 31 [nodoc] long? left; | 35 [nodoc] long? left; |
| 32 | 36 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // different ways. The most simple option is not specifying anything at | 119 // different ways. The most simple option is not specifying anything at |
| 116 // all, in which case a default size and platform dependent position will | 120 // all, in which case a default size and platform dependent position will |
| 117 // be used. | 121 // be used. |
| 118 // | 122 // |
| 119 // Another option is to use the top/left and width/height properties, | 123 // Another option is to use the top/left and width/height properties, |
| 120 // which will always put the window at the specified coordinates with the | 124 // which will always put the window at the specified coordinates with the |
| 121 // specified size. | 125 // specified size. |
| 122 // | 126 // |
| 123 // Yet another option is to give the window a (unique) id. This id is then | 127 // Yet another option is to give the window a (unique) id. This id is then |
| 124 // used to remember the size and position of the window whenever it is | 128 // used to remember the size and position of the window whenever it is |
| 125 // moved or resized. This size and position is then used on subsequent | 129 // moved or resized. This size and position is then used instead of the |
| 126 // opening of a window with the same id. The defaultLeft/defaultTop and | 130 // specified bounds on subsequent opening of a window with the same id. If |
| 127 // defaultWidth/defaultHeight properties can be used to specify a position | 131 // you need to open a window with an id at a location other than the |
| 128 // and size when no geometry has been stored for the window yet. | 132 // remembered default, you can create it hidden, move it to the desired |
| 133 // location, then show it. |
| 129 // | 134 // |
| 130 // You can also combine these various options, explicitly specifying for | 135 // You can also combine these various options, explicitly specifying for |
| 131 // example the size while having the position be remembered or other | 136 // example the size while having the position be remembered or other |
| 132 // combinations like that. Size and position are dealt with seperately, | 137 // combinations like that. Size and position are dealt with seperately, |
| 133 // but individual coordinates are not. So if you specify a top (or left) | 138 // but individual coordinates are not. So if you specify a top (or left) |
| 134 // coordinate, you should also specify a left (or top) coordinate, and | 139 // coordinate, you should also specify a left (or top) coordinate, and |
| 135 // similar for size. | 140 // similar for size. |
| 136 // | 141 // |
| 137 // If you specify both a regular and a default value for the same option | 142 // If you specify both a regular and a default value for the same option |
| 138 // the regular value is the only one that takes effect. | 143 // the regular value is the only one that takes effect. |
| 139 static void create(DOMString url, | 144 static void create(DOMString url, |
| 140 optional CreateWindowOptions options, | 145 optional CreateWindowOptions options, |
| 141 optional CreateWindowCallback callback); | 146 optional CreateWindowCallback callback); |
| 142 | 147 |
| 143 // Returns an <a href="#type-AppWindow">AppWindow</a> object for the | 148 // Returns an <a href="#type-AppWindow">AppWindow</a> object for the |
| 144 // current script context (ie JavaScript 'window' object). This can also be | 149 // current script context (ie JavaScript 'window' object). This can also be |
| 145 // called on a handle to a script context for another page, for example: | 150 // called on a handle to a script context for another page, for example: |
| 146 // otherWindow.chrome.app.window.current(). | 151 // otherWindow.chrome.app.window.current(). |
| 147 [nocompile] static AppWindow current(); | 152 [nocompile] static AppWindow current(); |
| 148 [nocompile, nodoc] static void initializeAppWindow(object state); | 153 [nocompile, nodoc] static void initializeAppWindow(object state); |
| 149 }; | 154 }; |
| 150 }; | 155 }; |
| OLD | NEW |