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

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: Created 8 years, 2 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
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 x;
jeremya 2012/10/19 00:26:45 as discussed in chat, left/top probably makes more
60 long y;
61 long width;
62 long height;
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 (|x|, |y|).
72 static void moveTo(long x, long y); 79 static void moveTo(long x, long y);
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
90 // Return a <a href="#type-Bounds">Bounds</a> with the position and size of
91 // the window.
92 static Bounds getBounds();
93
83 // The JavaScript 'window' object for the created child. 94 // The JavaScript 'window' object for the created child.
84 [instanceOf=global] object contentWindow; 95 [instanceOf=global] object contentWindow;
85 }; 96 };
86 97
87 interface Functions { 98 interface Functions {
88 // The size and position of a window can be specified in a number of 99 // The size and position of a window can be specified in a number of
89 // different ways. The most simple option is not specifying anything at 100 // different ways. The most simple option is not specifying anything at
90 // all, in which case a default size and platform dependent position will 101 // all, in which case a default size and platform dependent position will
91 // be used. 102 // be used.
92 // 103 //
(...skipping 14 matching lines...) Expand all
107 // but individual coordinates are not. So if you specify a top (or left) 118 // but individual coordinates are not. So if you specify a top (or left)
108 // coordinate, you should also specify a left (or top) coordinate, and 119 // coordinate, you should also specify a left (or top) coordinate, and
109 // similar for size. 120 // similar for size.
110 // 121 //
111 // If you specify both a regular and a default value for the same option 122 // If you specify both a regular and a default value for the same option
112 // the regular value is the only one that takes effect. 123 // the regular value is the only one that takes effect.
113 static void create(DOMString url, 124 static void create(DOMString url,
114 optional CreateWindowOptions options, 125 optional CreateWindowOptions options,
115 optional CreateWindowCallback callback); 126 optional CreateWindowCallback callback);
116 127
128 // Returns the current <a href="#type-AppWindow">AppWindow</a>.
117 [nocompile] static AppWindow current(); 129 [nocompile] static AppWindow current();
118 [nocompile, nodoc] static void initializeAppWindow(object state); 130 [nocompile, nodoc] static void initializeAppWindow(object state);
119 }; 131 };
120 }; 132 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698