| 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. This will be used to remember the size | 9 // Id to identify the window. This will be used to remember the size |
| 10 // and position of the window and restore that geometry when a window | 10 // and position of the window and restore that geometry when a window |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 long? maxHeight; | 48 long? maxHeight; |
| 49 | 49 |
| 50 // Window type: 'shell' (the default) is the only currently supported value. | 50 // Window type: 'shell' (the default) is the only currently supported value. |
| 51 DOMString? type; | 51 DOMString? type; |
| 52 | 52 |
| 53 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). | 53 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). |
| 54 DOMString? frame; | 54 DOMString? frame; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 callback CreateWindowCallback = | 57 callback CreateWindowCallback = |
| 58 void ([instanceOf=global] object created_window); | 58 void ([instanceOf=AppWindow] object created_window); |
| 59 |
| 60 dictionary AppWindow { |
| 61 // Focus the window. |
| 62 static void focus(); |
| 63 |
| 64 // Minimize the window. |
| 65 static void minimize(); |
| 66 |
| 67 // Maximize the window. |
| 68 static void maximize(); |
| 69 |
| 70 // Restore the window. |
| 71 static void restore(); |
| 72 |
| 73 // Move the window to the position (|x|, |y|). |
| 74 static void moveTo(long x, long y); |
| 75 |
| 76 // Move the window to the position (|x|, |y|). |
| 77 static void resizeTo(long x, long y); |
| 78 |
| 79 [instanceOf=global] object dom; |
| 80 }; |
| 59 | 81 |
| 60 interface Functions { | 82 interface Functions { |
| 61 // The size and position of a window can be specified in a number of | 83 // The size and position of a window can be specified in a number of |
| 62 // different ways. The most simple option is not specifying anything at | 84 // different ways. The most simple option is not specifying anything at |
| 63 // all, in which case a default size and platform dependent position will | 85 // all, in which case a default size and platform dependent position will |
| 64 // be used. | 86 // be used. |
| 65 // | 87 // |
| 66 // Another option is to use the top/left and width/height properties, | 88 // Another option is to use the top/left and width/height properties, |
| 67 // which will always put the window at the specified coordinates with the | 89 // which will always put the window at the specified coordinates with the |
| 68 // specified size. | 90 // specified size. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 80 // but individual coordinates are not. So if you specify a top (or left) | 102 // but individual coordinates are not. So if you specify a top (or left) |
| 81 // coordinate, you should also specify a left (or top) coordinate, and | 103 // coordinate, you should also specify a left (or top) coordinate, and |
| 82 // similar for size. | 104 // similar for size. |
| 83 // | 105 // |
| 84 // If you specify both a regular and a default value for the same option | 106 // If you specify both a regular and a default value for the same option |
| 85 // the regular value is the only one that takes effect. | 107 // the regular value is the only one that takes effect. |
| 86 static void create(DOMString url, | 108 static void create(DOMString url, |
| 87 optional CreateWindowOptions options, | 109 optional CreateWindowOptions options, |
| 88 optional CreateWindowCallback callback); | 110 optional CreateWindowCallback callback); |
| 89 | 111 |
| 90 static void focus(); | 112 [nocompile] static AppWindow current(); |
| 91 static void maximize(); | |
| 92 static void minimize(); | |
| 93 static void restore(); | |
| 94 [nocompile] static void moveTo(long x, long y); | |
| 95 [nocompile] static void resizeTo(long width, long height); | |
| 96 }; | 113 }; |
| 97 }; | 114 }; |
| OLD | NEW |