Chromium Code Reviews| 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 // File-level comment to appease parser. Eventually this will not be necessary. | 5 // File-level comment to appease parser. Eventually this will not be necessary. |
| 6 | 6 |
| 7 namespace app.window { | 7 namespace app.window { |
| 8 dictionary CreateWindowOptions { | 8 dictionary CreateWindowOptions { |
| 9 // Id to identify the window. | |
| 10 DOMString? id; | |
| 11 | |
| 12 // Default width of the window. | |
| 13 long? defaultWidth; | |
| 14 | |
| 15 // Default height of the window. | |
| 16 long? defaultHeight; | |
| 17 | |
| 18 // Default X coordinate of the window. | |
| 19 long? defaultLeft; | |
| 20 | |
| 21 // Default Y coordinate of the window. | |
| 22 long? defaultTop; | |
| 23 | |
| 9 // Width of the window. | 24 // Width of the window. |
| 10 long? width; | 25 long? width; |
| 11 | 26 |
| 12 // Height of the window. | 27 // Height of the window. |
| 13 long? height; | 28 long? height; |
| 14 | 29 |
| 15 // X coordinate of the window. | 30 // X coordinate of the window. |
| 16 long? left; | 31 long? left; |
| 17 | 32 |
| 18 // Y coordinate of the window. | 33 // Y coordinate of the window. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 34 DOMString? type; | 49 DOMString? type; |
| 35 | 50 |
| 36 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). | 51 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). |
| 37 DOMString? frame; | 52 DOMString? frame; |
| 38 }; | 53 }; |
| 39 | 54 |
| 40 callback CreateWindowCallback = | 55 callback CreateWindowCallback = |
| 41 void ([instanceOf=global] object created_window); | 56 void ([instanceOf=global] object created_window); |
| 42 | 57 |
| 43 interface Functions { | 58 interface Functions { |
| 59 // The size and position of a window can be specified in a number of | |
| 60 // different ways. The most simple option is not specifying anything at all, | |
| 61 // in which case a default size and platform dependent position will be used . | |
|
Mihai Parparita -not on Chrome
2012/08/29 21:39:14
Nit: some lines appear to be > 80 characters.
Marijn Kruisselbrink
2012/08/29 22:31:33
Done.
| |
| 62 // | |
| 63 // Another option is to use the top/left and width/height properties, which | |
| 64 // will always put the window at the specified coordinates with the specifie d | |
| 65 // size. | |
| 66 // | |
| 67 // Yet another option is to give the window a (unique) id. This id is then | |
| 68 // used to remember the size and position of the window whenever it is moved | |
| 69 // or resized. This size and position is then used on subsequent opening of | |
| 70 // a window with the same id. The defaultLeft/defaultTop and | |
| 71 // defaultWidth/defaultHeight properties can be used to specify a position | |
| 72 // and size when no geometry has been stored for the window yet. | |
| 73 // | |
| 74 // You can also combine these various options, explicitly specifying for | |
| 75 // example the size while having the position be remembered or other | |
| 76 // combinations like that. Size and position are dealt with seperately, | |
| 77 // but individual coordinates are not. So if you specify a top (or left) | |
| 78 // coordinate, you should also specify a left (or top) coordinate, and simil ar | |
| 79 // for size. | |
| 80 // | |
| 81 // If you specify both a regular and a default value for the same option | |
| 82 // the regular value is the only one that takes effect. | |
| 44 static void create(DOMString url, | 83 static void create(DOMString url, |
| 45 optional CreateWindowOptions options, | 84 optional CreateWindowOptions options, |
| 46 optional CreateWindowCallback callback); | 85 optional CreateWindowCallback callback); |
| 47 | 86 |
| 48 static void focus(); | 87 static void focus(); |
| 49 static void maximize(); | 88 static void maximize(); |
| 50 static void minimize(); | 89 static void minimize(); |
| 51 static void restore(); | 90 static void restore(); |
| 52 [nocompile] static void moveTo(long x, long y); | 91 [nocompile] static void moveTo(long x, long y); |
| 53 [nocompile] static void resizeTo(long width, long height); | 92 [nocompile] static void resizeTo(long width, long height); |
| 54 }; | 93 }; |
| 55 }; | 94 }; |
| OLD | NEW |