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. See the <a | 7 // associated with any Chrome browser windows. See the <a |
8 // href="https://github.com/GoogleChrome/chrome-app-samples/tree/master/window-s
tate"> | 8 // href="https://github.com/GoogleChrome/chrome-app-samples/tree/master/window-s
tate"> |
9 // Window State Sample</a> for a demonstration of these options. | 9 // Window State Sample</a> for a demonstration of these options. |
10 namespace app.window { | 10 namespace app.window { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // multiple windows of this kind, the currently focused window will be in | 256 // multiple windows of this kind, the currently focused window will be in |
257 // the foreground. Requires the <code>"alwaysOnTopWindows"</code> | 257 // the foreground. Requires the <code>"alwaysOnTopWindows"</code> |
258 // permission. Defaults to false. | 258 // permission. Defaults to false. |
259 // | 259 // |
260 // Call <code>setAlwaysOnTop()</code> on the window to change this property | 260 // Call <code>setAlwaysOnTop()</code> on the window to change this property |
261 // after creation. | 261 // after creation. |
262 boolean? alwaysOnTop; | 262 boolean? alwaysOnTop; |
263 | 263 |
264 // If true, the window will be focused when created. Defaults to true. | 264 // If true, the window will be focused when created. Defaults to true. |
265 boolean? focused; | 265 boolean? focused; |
| 266 |
| 267 // If true, the window will be visible on all workspaces. |
| 268 // This is only available on dev channel. |
| 269 boolean? visibleOnAllWorkspaces; |
266 }; | 270 }; |
267 | 271 |
268 // Called in the creating window (parent) before the load event is called in | 272 // Called in the creating window (parent) before the load event is called in |
269 // the created window (child). The parent can set fields or functions on the | 273 // the created window (child). The parent can set fields or functions on the |
270 // child usable from onload. E.g. background.js: | 274 // child usable from onload. E.g. background.js: |
271 // | 275 // |
272 // <code>function(createdWindow) { createdWindow.contentWindow.foo = | 276 // <code>function(createdWindow) { createdWindow.contentWindow.foo = |
273 // function () { }; };</code> | 277 // function () { }; };</code> |
274 // | 278 // |
275 // window.js: | 279 // window.js: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 [nodoc] boolean? firstShowHasHappened; | 366 [nodoc] boolean? firstShowHasHappened; |
363 | 367 |
364 // Set whether the window should stay above most other windows. Requires the | 368 // Set whether the window should stay above most other windows. Requires the |
365 // <code>"alwaysOnTopWindows"</code> permission. | 369 // <code>"alwaysOnTopWindows"</code> permission. |
366 static void setAlwaysOnTop(boolean alwaysOnTop); | 370 static void setAlwaysOnTop(boolean alwaysOnTop); |
367 | 371 |
368 // Can the window use alpha transparency? | 372 // Can the window use alpha transparency? |
369 // TODO(jackhou): Document this properly before going to stable. | 373 // TODO(jackhou): Document this properly before going to stable. |
370 [nodoc] static boolean alphaEnabled(); | 374 [nodoc] static boolean alphaEnabled(); |
371 | 375 |
| 376 // For platforms that support multiple workspaces, is this window visible on |
| 377 // all of them? |
| 378 // This is only available on dev channel. |
| 379 static void setVisibleOnAllWorkspaces(boolean alwaysVisible); |
| 380 |
372 // The JavaScript 'window' object for the created child. | 381 // The JavaScript 'window' object for the created child. |
373 [instanceOf=Window] object contentWindow; | 382 [instanceOf=Window] object contentWindow; |
374 | 383 |
375 // The id the window was created with. | 384 // The id the window was created with. |
376 DOMString id; | 385 DOMString id; |
377 | 386 |
378 // The position, size and constraints of the window's content, which does | 387 // The position, size and constraints of the window's content, which does |
379 // not include window decorations. | 388 // not include window decorations. |
380 // This property is new in Chrome 36. | 389 // This property is new in Chrome 36. |
381 Bounds innerBounds; | 390 Bounds innerBounds; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 [nocompile] static AppWindow current(); | 428 [nocompile] static AppWindow current(); |
420 [nocompile, nodoc] static void initializeAppWindow(object state); | 429 [nocompile, nodoc] static void initializeAppWindow(object state); |
421 | 430 |
422 // Gets an array of all currently created app windows. This method is new in | 431 // Gets an array of all currently created app windows. This method is new in |
423 // Chrome 33. | 432 // Chrome 33. |
424 [nocompile] static AppWindow[] getAll(); | 433 [nocompile] static AppWindow[] getAll(); |
425 | 434 |
426 // Gets an $(ref:AppWindow) with the given id. If no window with the given i
d | 435 // Gets an $(ref:AppWindow) with the given id. If no window with the given i
d |
427 // exists null is returned. This method is new in Chrome 33. | 436 // exists null is returned. This method is new in Chrome 33. |
428 [nocompile] static AppWindow get(DOMString id); | 437 [nocompile] static AppWindow get(DOMString id); |
| 438 |
| 439 // Does the current platform support windows being visible on all |
| 440 // workspaces? |
| 441 [nocompile] static boolean canSetVisibleOnAllWorkspaces(); |
429 }; | 442 }; |
430 | 443 |
431 interface Events { | 444 interface Events { |
432 // Fired when the window is resized. | 445 // Fired when the window is resized. |
433 [nocompile] static void onBoundsChanged(); | 446 [nocompile] static void onBoundsChanged(); |
434 | 447 |
435 // Fired when the window is closed. Note, this should be listened to from | 448 // Fired when the window is closed. Note, this should be listened to from |
436 // a window other than the window being closed, for example from the | 449 // a window other than the window being closed, for example from the |
437 // background page. This is because the window being closed will be in the | 450 // background page. This is because the window being closed will be in the |
438 // process of being torn down when the event is fired, which means not all | 451 // process of being torn down when the event is fired, which means not all |
(...skipping 12 matching lines...) Expand all Loading... |
451 // Fired when the window is restored from being minimized or maximized. | 464 // Fired when the window is restored from being minimized or maximized. |
452 [nocompile] static void onRestored(); | 465 [nocompile] static void onRestored(); |
453 | 466 |
454 // Fired when the window's ability to use alpha transparency changes. | 467 // Fired when the window's ability to use alpha transparency changes. |
455 [nocompile, nodoc] static void onAlphaEnabledChanged(); | 468 [nocompile, nodoc] static void onAlphaEnabledChanged(); |
456 | 469 |
457 // Event for testing. Lets tests wait until a window has been shown. | 470 // Event for testing. Lets tests wait until a window has been shown. |
458 [nocompile, nodoc] static void onWindowFirstShown(); | 471 [nocompile, nodoc] static void onWindowFirstShown(); |
459 }; | 472 }; |
460 }; | 473 }; |
OLD | NEW |