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

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

Issue 11193049: Add the app.windows.getBounds method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased against head Created 8 years, 1 month 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
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 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 DOMString? frame; 52 DOMString? frame;
53 53
54 // If true, the window will be created in a hidden state. Call show() on 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. 55 // the window to show it once it has been created. Defaults to false.
56 boolean? hidden; 56 boolean? hidden;
57 }; 57 };
58 58
59 callback CreateWindowCallback = 59 callback CreateWindowCallback =
60 void ([instanceOf=AppWindow] object created_window); 60 void ([instanceOf=AppWindow] object created_window);
61 61
62 dictionary Bounds {
63 long? left;
64 long? top;
65 long? width;
66 long? height;
67 };
68
62 dictionary AppWindow { 69 dictionary AppWindow {
63 // Focus the window. 70 // Focus the window.
64 static void focus(); 71 static void focus();
65 72
66 // Minimize the window. 73 // Minimize the window.
67 static void minimize(); 74 static void minimize();
68 75
69 // Maximize the window. 76 // Maximize the window.
70 static void maximize(); 77 static void maximize();
71 78
72 // Restore the window. 79 // Restore the window.
73 static void restore(); 80 static void restore();
74 81
75 // Move the window to the position (|x|, |y|). 82 // Move the window to the position (|left|, |top|).
76 static void moveTo(long x, long y); 83 static void moveTo(long left, long top);
77 84
78 // Resize the window to |width|x|height| pixels in size. 85 // Resize the window to |width|x|height| pixels in size.
79 static void resizeTo(long width, long height); 86 static void resizeTo(long width, long height);
80 87
81 // Draw attention to the window. 88 // Draw attention to the window.
82 static void drawAttention(); 89 static void drawAttention();
83 90
84 // Clear attention to the window. 91 // Clear attention to the window.
85 static void clearAttention(); 92 static void clearAttention();
86 93
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // but individual coordinates are not. So if you specify a top (or left) 127 // but individual coordinates are not. So if you specify a top (or left)
121 // coordinate, you should also specify a left (or top) coordinate, and 128 // coordinate, you should also specify a left (or top) coordinate, and
122 // similar for size. 129 // similar for size.
123 // 130 //
124 // If you specify both a regular and a default value for the same option 131 // If you specify both a regular and a default value for the same option
125 // the regular value is the only one that takes effect. 132 // the regular value is the only one that takes effect.
126 static void create(DOMString url, 133 static void create(DOMString url,
127 optional CreateWindowOptions options, 134 optional CreateWindowOptions options,
128 optional CreateWindowCallback callback); 135 optional CreateWindowCallback callback);
129 136
137 // Returns an <a href="#type-AppWindow">AppWindow</a> object for the
138 // current script context (ie JavaScript 'window' object). This can also be
139 // called on a handle to a script context for another page, for example:
140 // otherWindow.chrome.app.window.current().
130 [nocompile] static AppWindow current(); 141 [nocompile] static AppWindow current();
131 [nocompile, nodoc] static void initializeAppWindow(object state); 142 [nocompile, nodoc] static void initializeAppWindow(object state);
132 }; 143 };
133 }; 144 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698