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 // Use the <code>chrome.app.window</code> API to create windows. Windows | 5 // Use the <code>chrome.app.window</code> API to create windows. Windows |
6 // have an optional frame with title bar and size controls. They are not | 6 // have an optional frame with title bar and size controls. They are not |
7 // associated with any Chrome browser windows. | 7 // associated with any Chrome browser windows. |
8 namespace app.window { | 8 namespace app.window { |
9 dictionary Bounds { | 9 dictionary Bounds { |
10 long? left; | 10 long? left; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 // function () { }; };</code> | 128 // function () { }; };</code> |
129 // <br>window.js:<br> | 129 // <br>window.js:<br> |
130 // <code>window.onload = function () { foo(); }</code> | 130 // <code>window.onload = function () { foo(); }</code> |
131 callback CreateWindowCallback = | 131 callback CreateWindowCallback = |
132 void ([instanceOf=AppWindow] object createdWindow); | 132 void ([instanceOf=AppWindow] object createdWindow); |
133 | 133 |
134 [noinline_doc] dictionary AppWindow { | 134 [noinline_doc] dictionary AppWindow { |
135 // Focus the window. | 135 // Focus the window. |
136 static void focus(); | 136 static void focus(); |
137 | 137 |
138 // Fullscreens the window. | 138 // Fullscreens the window.<br> |
139 // The user will be able to restore the window by pressing ESC. An | |
140 // application can prevent the fullscreen state to be left when ESC is | |
141 // pressed by requesting the <b>overrideEscFullscreen</b> permission and | |
142 // canceling the event by calling .preventDefault(), like this:<br> | |
143 // <code>function(createdWindow) { createdWindow.contentWindow.onKeyDown = | |
144 // function(e) { if (e.keyCode == 27 /* ESC */) { e.preventDefault(); } } }; | |
benwells
2014/01/06 05:28:24
Nit: Just having the below is enough:
window.onKe
| |
145 // </code> | |
139 static void fullscreen(); | 146 static void fullscreen(); |
140 | 147 |
141 // Is the window fullscreen? | 148 // Is the window fullscreen? |
142 static boolean isFullscreen(); | 149 static boolean isFullscreen(); |
143 | 150 |
144 // Minimize the window. | 151 // Minimize the window. |
145 static void minimize(); | 152 static void minimize(); |
146 | 153 |
147 // Is the window minimized? | 154 // Is the window minimized? |
148 static boolean isMinimized(); | 155 static boolean isMinimized(); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 // Fired when the window is maximized. | 295 // Fired when the window is maximized. |
289 [nocompile] static void onMaximized(); | 296 [nocompile] static void onMaximized(); |
290 | 297 |
291 // Fired when the window is minimized. | 298 // Fired when the window is minimized. |
292 [nocompile] static void onMinimized(); | 299 [nocompile] static void onMinimized(); |
293 | 300 |
294 // Fired when the window is restored from being minimized or maximized. | 301 // Fired when the window is restored from being minimized or maximized. |
295 [nocompile] static void onRestored(); | 302 [nocompile] static void onRestored(); |
296 }; | 303 }; |
297 }; | 304 }; |
OLD | NEW |