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

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

Issue 10915085: Functions for accessing app window properties, and modifying AppWindow-specifics (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: stray event, js linter Created 8 years, 3 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
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 // minimized / maximized state of a window or normal/restored/resizable
7 enum WindowState {normal, minimized, maximized, fullscreen};
8
6 dictionary CreateWindowOptions { 9 dictionary CreateWindowOptions {
7 // Id to identify the window. This will be used to remember the size 10 // 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 11 // 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. 12 // with the same id (and no explicit size or position) is later opened.
10 DOMString? id; 13 DOMString? id;
11 14
12 // Default width of the window. 15 // Default width of the window.
13 long? defaultWidth; 16 long? defaultWidth;
14 17
15 // Default height of the window. 18 // Default height of the window.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 DOMString? type; 52 DOMString? type;
50 53
51 // Frame type: 'none' or 'chrome' (defaults to 'chrome'). 54 // Frame type: 'none' or 'chrome' (defaults to 'chrome').
52 DOMString? frame; 55 DOMString? frame;
53 }; 56 };
54 57
55 callback CreateWindowCallback = 58 callback CreateWindowCallback =
56 void ([instanceOf=AppWindow] object created_window); 59 void ([instanceOf=AppWindow] object created_window);
57 60
58 dictionary AppWindow { 61 dictionary AppWindow {
62 // The identity of this window used on creation for persisting state
Mihai Parparita -not on Chrome 2012/09/16 05:31:39 Nit: this was called "id" in the create params, so
tapted 2012/09/17 08:48:56 sticking with `id` in crrev.com/10910304/
63 DOMString windowKey;
64
65 // The internal routing ID, to lookup properties
66 [nodoc] long viewId;
67
68 // The last known width of the window
69 long width;
70
71 // The last known height of the window
72 long height;
73
74 // The last known screenX position
75 long left;
76
77 // The last known screenY position
78 long top;
79
80 // Check if the window currently has focus
81 boolean hasFocus;
82
83 // Get the current window state
84 DOMString windowState;
Mihai Parparita -not on Chrome 2012/09/16 05:31:39 Why not use the WindowState enum here?
tapted 2012/09/17 08:48:56 will do
85
86 // Get the minimum user-resizable dimensions of the window
87 long minWidth;
88 long minHeight;
89
90 // Get the maximum user-resizable dimensions of the window
91 long maxWidth;
92 long maxHeight;
93
94 // Get the window type (e.g. 'shell')
95 DOMString windowType;
96
97 // Get the frame type (e.g. 'none' or 'chrome')
98 DOMString frameType;
99
59 // Focus the window. 100 // Focus the window.
60 static void focus(); 101 static void focus();
61 102
62 // Minimize the window. 103 // Minimize the window.
63 static void minimize(); 104 static void minimize();
64 105
65 // Maximize the window. 106 // Maximize the window.
66 static void maximize(); 107 static void maximize();
67 108
68 // Restore the window. 109 // Restore the window.
69 static void restore(); 110 static void restore();
70 111
71 // Move the window to the position (|x|, |y|). 112 // Move the window to the position (|x|, |y|).
72 static void moveTo(long x, long y); 113 static void moveTo(long x, long y);
73 114
74 // Resize the window to |width|x|height| pixels in size. 115 // Resize the window to |width|x|height| pixels in size.
75 static void resizeTo(long width, long height); 116 static void resizeTo(long width, long height);
76 117
118 // Update the minimum user-resizable dimensions of the window
119 static void setMinSize(long x, long y);
120
121 // Update the maximum user-resizable dimensions of the window
122 static void setMaxSize(long x, long y);
123
77 // The JavaScript 'window' object for the created child. 124 // The JavaScript 'window' object for the created child.
78 [instanceOf=global] object contentWindow; 125 [instanceOf=global] object contentWindow;
79 }; 126 };
80 127
81 interface Functions { 128 interface Functions {
82 // The size and position of a window can be specified in a number of 129 // 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 130 // different ways. The most simple option is not specifying anything at
84 // all, in which case a default size and platform dependent position will 131 // all, in which case a default size and platform dependent position will
85 // be used. 132 // be used.
86 // 133 //
(...skipping 15 matching lines...) Expand all
102 // coordinate, you should also specify a left (or top) coordinate, and 149 // coordinate, you should also specify a left (or top) coordinate, and
103 // similar for size. 150 // similar for size.
104 // 151 //
105 // If you specify both a regular and a default value for the same option 152 // 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. 153 // the regular value is the only one that takes effect.
107 static void create(DOMString url, 154 static void create(DOMString url,
108 optional CreateWindowOptions options, 155 optional CreateWindowOptions options,
109 optional CreateWindowCallback callback); 156 optional CreateWindowCallback callback);
110 157
111 [nocompile] static AppWindow current(); 158 [nocompile] static AppWindow current();
159 [internal, nocompile] static void makeAppWindow(object state);
112 }; 160 };
113 }; 161 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698