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 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; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 long? maxWidth; | 43 long? maxWidth; |
| 44 | 44 |
| 45 // Maximum height of the window. | 45 // Maximum height of the window. |
| 46 long? maxHeight; | 46 long? maxHeight; |
| 47 | 47 |
| 48 // Window type: 'shell' (the default) is the only currently supported value. | 48 // Window type: 'shell' (the default) is the only currently supported value. |
| 49 DOMString? type; | 49 DOMString? type; |
| 50 | 50 |
| 51 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). | 51 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). |
| 52 DOMString? frame; | 52 DOMString? frame; |
| 53 | |
| 54 // If true, the window will be created in a hidden state. Call show() on | |
| 55 // the window to show it once it has been created. Defaults to false. | |
| 56 boolean? hidden; | |
|
benwells
2012/10/16 05:54:55
Hidden windows will keep their browser keep alive,
jeremya
2012/10/16 06:31:32
That's true. Perhaps the keepalive should check vi
| |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 callback CreateWindowCallback = | 59 callback CreateWindowCallback = |
| 56 void ([instanceOf=AppWindow] object created_window); | 60 void ([instanceOf=AppWindow] object created_window); |
| 57 | 61 |
| 58 dictionary AppWindow { | 62 dictionary AppWindow { |
| 59 // Focus the window. | 63 // Focus the window. |
| 60 static void focus(); | 64 static void focus(); |
| 61 | 65 |
| 62 // Minimize the window. | 66 // Minimize the window. |
| 63 static void minimize(); | 67 static void minimize(); |
| 64 | 68 |
| 65 // Maximize the window. | 69 // Maximize the window. |
| 66 static void maximize(); | 70 static void maximize(); |
| 67 | 71 |
| 68 // Restore the window. | 72 // Restore the window. |
| 69 static void restore(); | 73 static void restore(); |
| 70 | 74 |
| 71 // Move the window to the position (|x|, |y|). | 75 // Move the window to the position (|x|, |y|). |
| 72 static void moveTo(long x, long y); | 76 static void moveTo(long x, long y); |
| 73 | 77 |
| 74 // Resize the window to |width|x|height| pixels in size. | 78 // Resize the window to |width|x|height| pixels in size. |
| 75 static void resizeTo(long width, long height); | 79 static void resizeTo(long width, long height); |
| 76 | 80 |
| 81 // Show the window. Does nothing if the window is already visible. | |
| 82 static void show(); | |
| 83 | |
| 84 // Hide the window. Does nothing if the window is already hidden. | |
| 85 static void hide(); | |
| 86 | |
| 77 // The JavaScript 'window' object for the created child. | 87 // The JavaScript 'window' object for the created child. |
| 78 [instanceOf=global] object contentWindow; | 88 [instanceOf=global] object contentWindow; |
| 79 }; | 89 }; |
| 80 | 90 |
| 81 interface Functions { | 91 interface Functions { |
| 82 // The size and position of a window can be specified in a number of | 92 // The size and position of a window can be specified in a number of |
| 83 // different ways. The most simple option is not specifying anything at | 93 // different ways. The most simple option is not specifying anything at |
| 84 // all, in which case a default size and platform dependent position will | 94 // all, in which case a default size and platform dependent position will |
| 85 // be used. | 95 // be used. |
| 86 // | 96 // |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 105 // If you specify both a regular and a default value for the same option | 115 // If you specify both a regular and a default value for the same option |
| 106 // the regular value is the only one that takes effect. | 116 // the regular value is the only one that takes effect. |
| 107 static void create(DOMString url, | 117 static void create(DOMString url, |
| 108 optional CreateWindowOptions options, | 118 optional CreateWindowOptions options, |
| 109 optional CreateWindowCallback callback); | 119 optional CreateWindowCallback callback); |
| 110 | 120 |
| 111 [nocompile] static AppWindow current(); | 121 [nocompile] static AppWindow current(); |
| 112 [nocompile, nodoc] static void initializeAppWindow(object state); | 122 [nocompile, nodoc] static void initializeAppWindow(object state); |
| 113 }; | 123 }; |
| 114 }; | 124 }; |
| OLD | NEW |