Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/common/extensions/api/app_window.idl

Issue 14037005: Improve app.window documentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Bounds { 6 dictionary Bounds {
7 long? left; 7 long? left;
8 long? top; 8 long? top;
9 long? width; 9 long? width;
10 long? height; 10 long? height;
11 }; 11 };
12 12
13 // State of a window: normal, fullscreen, maximized, minimized. 13 // State of a window: normal, fullscreen, maximized, minimized.
14 enum State { normal, fullscreen, maximized, minimized }; 14 enum State { normal, fullscreen, maximized, minimized };
15 15
16 // 'shell' is the default window type. 'panel' is managed by the OS 16 // 'shell' is the default window type. 'panel' is managed by the OS
17 // (Currently experimental, Ash only). 17 // (Currently experimental, Ash only).
18 [nodoc] enum WindowType { shell, panel }; 18 [nodoc] enum WindowType { shell, panel };
19 19
20 dictionary CreateWindowOptions { 20 dictionary CreateWindowOptions {
21 // Id to identify the window. This will be used to remember the size 21 // Id to identify the window. This will be used to remember the size
22 // and position of the window and restore that geometry when a window 22 // and position of the window and restore that geometry when a window
23 // with the same id (and no explicit size or position) is later opened. 23 // with the same id is later opened.
24 DOMString? id; 24 DOMString? id;
25 25
26 // Default width of the window. (Deprecated; regular bounds act like this 26 // Default width of the window. (Deprecated; regular bounds act like this
27 // now.) 27 // now.)
28 [nodoc] long? defaultWidth; 28 [nodoc] long? defaultWidth;
29 29
30 // Default height of the window. (Deprecated; regular bounds act like this 30 // Default height of the window. (Deprecated; regular bounds act like this
31 // now.) 31 // now.)
32 [nodoc] long? defaultHeight; 32 [nodoc] long? defaultHeight;
33 33
(...skipping 28 matching lines...) Expand all
62 62
63 // Maximum height for the lifetime of the window. 63 // Maximum height for the lifetime of the window.
64 long? maxHeight; 64 long? maxHeight;
65 65
66 // Type of window to create. 66 // Type of window to create.
67 [nodoc] WindowType? type; 67 [nodoc] WindowType? type;
68 68
69 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). 69 // Frame type: 'none' or 'chrome' (defaults to 'chrome').
70 DOMString? frame; 70 DOMString? frame;
71 71
72 // Size of the content in the window (excluding the titlebar). If specified 72 // Size and position of the content in the window (excluding the titlebar).
73 // in addition to any of the deprecated left/top/width/height parameters, 73 // If an id is also specified and a window with a matching id has been shown
74 // this field takes precedence. 74 // before, the remembered bounds of the window will be used instead.
75 // If specified in addition to any of the deprecated left/top/width/height
76 // parameters, this field takes precedence.
jeremya 2013/04/12 17:09:07 Perhaps we could remove this comment about the dep
benwells 2013/05/07 11:43:56 Done.
75 Bounds? bounds; 77 Bounds? bounds;
76 78
77 // Enable window background transparency. 79 // Enable window background transparency.
78 // Only supported in ash. Requires experimental API permission. 80 // Only supported in ash. Requires experimental API permission.
79 boolean? transparentBackground; 81 boolean? transparentBackground;
80 82
81 // The initial state of the window, allowing it to be created already 83 // The initial state of the window, allowing it to be created already
82 // fullscreen, maximized, or minimized. Defaults to 'normal'. 84 // fullscreen, maximized, or minimized. Defaults to 'normal'.
83 State? state; 85 State? state;
84 86
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // The JavaScript 'window' object for the created child. 162 // The JavaScript 'window' object for the created child.
161 [instanceOf=global] object contentWindow; 163 [instanceOf=global] object contentWindow;
162 }; 164 };
163 165
164 interface Functions { 166 interface Functions {
165 // The size and position of a window can be specified in a number of 167 // The size and position of a window can be specified in a number of
166 // different ways. The most simple option is not specifying anything at 168 // different ways. The most simple option is not specifying anything at
167 // all, in which case a default size and platform dependent position will 169 // all, in which case a default size and platform dependent position will
168 // be used. 170 // be used.
169 // 171 //
170 // Another option is to use the top/left and width/height properties, 172 // Another option is to use the bounds property, which will put the window
171 // which will always put the window at the specified coordinates with the 173 // at the specified coordinates with the specified size. If the window has
172 // specified size. 174 // a frame, it's total size will be the size given plus the size of the
175 // frame; that is, the size in bounds is the content size, not the window
176 // size.
173 // 177 //
174 // Yet another option is to give the window a (unique) id. This id is then 178 // To automatically remember the positions of windows you can give them ids.
175 // used to remember the size and position of the window whenever it is 179 // If a window has an id, This id is used to remember the size and position
176 // moved or resized. This size and position is then used instead of the 180 // of the window whenever it is moved or resized. This size and position is
177 // specified bounds on subsequent opening of a window with the same id. If 181 // then used instead of the specified bounds on subsequent opening of a
178 // you need to open a window with an id at a location other than the 182 // window with the same id. If you need to open a window with an id at a
179 // remembered default, you can create it hidden, move it to the desired 183 // location other than the remembered default, you can create it hidden,
180 // location, then show it. 184 // move it to the desired location, then show it.
181 //
182 // You can also combine these various options, explicitly specifying for
183 // example the size while having the position be remembered or other
184 // combinations like that. Size and position are dealt with seperately,
185 // but individual coordinates are not. So if you specify a top (or left)
186 // coordinate, you should also specify a left (or top) coordinate, and
187 // similar for size.
188 //
189 // If you specify both a regular and a default value for the same option
190 // the regular value is the only one that takes effect.
191 static void create(DOMString url, 185 static void create(DOMString url,
192 optional CreateWindowOptions options, 186 optional CreateWindowOptions options,
193 optional CreateWindowCallback callback); 187 optional CreateWindowCallback callback);
194 188
195 // Returns an $ref:AppWindow object for the 189 // Returns an $ref:AppWindow object for the
196 // current script context (ie JavaScript 'window' object). This can also be 190 // current script context (ie JavaScript 'window' object). This can also be
197 // called on a handle to a script context for another page, for example: 191 // called on a handle to a script context for another page, for example:
198 // otherWindow.chrome.app.window.current(). 192 // otherWindow.chrome.app.window.current().
199 [nocompile] static AppWindow current(); 193 [nocompile] static AppWindow current();
200 [nocompile, nodoc] static void initializeAppWindow(object state); 194 [nocompile, nodoc] static void initializeAppWindow(object state);
(...skipping 12 matching lines...) Expand all
213 // Fired when the window is maximized. 207 // Fired when the window is maximized.
214 [nocompile] static void onMaximized(); 208 [nocompile] static void onMaximized();
215 209
216 // Fired when the window is minimized. 210 // Fired when the window is minimized.
217 [nocompile] static void onMinimized(); 211 [nocompile] static void onMinimized();
218 212
219 // Fired when the window is restored from being minimized or maximized. 213 // Fired when the window is restored from being minimized or maximized.
220 [nocompile] static void onRestored(); 214 [nocompile] static void onRestored();
221 }; 215 };
222 }; 216 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698