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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 }; | 53 }; |
| 54 | 54 |
| 55 callback CreateWindowCallback = | 55 callback CreateWindowCallback = |
| 56 void ([instanceOf=AppWindow] object created_window); | 56 void ([instanceOf=AppWindow] object created_window); |
| 57 | 57 |
| 58 dictionary Bounds { | |
| 59 long left; | |
| 60 long top; | |
| 61 long width; | |
| 62 long height; | |
|
jeremya
2012/10/31 03:12:21
These should be optional. I think it makes sense t
asargent_no_longer_on_chrome
2012/10/31 05:37:35
Done.
| |
| 63 }; | |
| 64 | |
| 58 dictionary AppWindow { | 65 dictionary AppWindow { |
| 59 // Focus the window. | 66 // Focus the window. |
| 60 static void focus(); | 67 static void focus(); |
| 61 | 68 |
| 62 // Minimize the window. | 69 // Minimize the window. |
| 63 static void minimize(); | 70 static void minimize(); |
| 64 | 71 |
| 65 // Maximize the window. | 72 // Maximize the window. |
| 66 static void maximize(); | 73 static void maximize(); |
| 67 | 74 |
| 68 // Restore the window. | 75 // Restore the window. |
| 69 static void restore(); | 76 static void restore(); |
| 70 | 77 |
| 71 // Move the window to the position (|x|, |y|). | 78 // Move the window to the position (|left|, |top|). |
| 72 static void moveTo(long x, long y); | 79 static void moveTo(long left, long top); |
| 73 | 80 |
| 74 // Resize the window to |width|x|height| pixels in size. | 81 // Resize the window to |width|x|height| pixels in size. |
| 75 static void resizeTo(long width, long height); | 82 static void resizeTo(long width, long height); |
| 76 | 83 |
| 77 // Draw attention to the window. | 84 // Draw attention to the window. |
| 78 static void drawAttention(); | 85 static void drawAttention(); |
| 79 | 86 |
| 80 // Clear attention to the window. | 87 // Clear attention to the window. |
| 81 static void clearAttention(); | 88 static void clearAttention(); |
| 82 | 89 |
| 83 // Close the window. | 90 // Close the window. |
| 84 static void close(); | 91 static void close(); |
| 85 | 92 |
| 93 // Return a <a href="#type-Bounds">Bounds</a> with the position and size of | |
| 94 // the window. | |
| 95 static Bounds getBounds(); | |
| 96 | |
| 86 // The JavaScript 'window' object for the created child. | 97 // The JavaScript 'window' object for the created child. |
| 87 [instanceOf=global] object contentWindow; | 98 [instanceOf=global] object contentWindow; |
| 88 }; | 99 }; |
| 89 | 100 |
| 90 interface Functions { | 101 interface Functions { |
| 91 // The size and position of a window can be specified in a number of | 102 // The size and position of a window can be specified in a number of |
| 92 // different ways. The most simple option is not specifying anything at | 103 // different ways. The most simple option is not specifying anything at |
| 93 // all, in which case a default size and platform dependent position will | 104 // all, in which case a default size and platform dependent position will |
| 94 // be used. | 105 // be used. |
| 95 // | 106 // |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 110 // but individual coordinates are not. So if you specify a top (or left) | 121 // but individual coordinates are not. So if you specify a top (or left) |
| 111 // coordinate, you should also specify a left (or top) coordinate, and | 122 // coordinate, you should also specify a left (or top) coordinate, and |
| 112 // similar for size. | 123 // similar for size. |
| 113 // | 124 // |
| 114 // If you specify both a regular and a default value for the same option | 125 // If you specify both a regular and a default value for the same option |
| 115 // the regular value is the only one that takes effect. | 126 // the regular value is the only one that takes effect. |
| 116 static void create(DOMString url, | 127 static void create(DOMString url, |
| 117 optional CreateWindowOptions options, | 128 optional CreateWindowOptions options, |
| 118 optional CreateWindowCallback callback); | 129 optional CreateWindowCallback callback); |
| 119 | 130 |
| 131 // Returns the current <a href="#type-AppWindow">AppWindow</a>. | |
|
jeremya
2012/10/31 00:32:46
I don't think this really makes clear the behaviou
asargent_no_longer_on_chrome
2012/10/31 05:37:35
I tried rewording it to use similar language to th
| |
| 120 [nocompile] static AppWindow current(); | 132 [nocompile] static AppWindow current(); |
| 121 [nocompile, nodoc] static void initializeAppWindow(object state); | 133 [nocompile, nodoc] static void initializeAppWindow(object state); |
| 122 }; | 134 }; |
| 123 }; | 135 }; |
| OLD | NEW |