Chromium Code Reviews| 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. | |
|
benwells
2014/08/20 05:02:08
You should mention that this is only available in
jackhou1
2014/08/27 05:10:45
Done.
| |
| 268 boolean? visibleOnAllWorkspaces; | |
| 266 }; | 269 }; |
| 267 | 270 |
| 268 // Called in the creating window (parent) before the load event is called in | 271 // 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 | 272 // the created window (child). The parent can set fields or functions on the |
| 270 // child usable from onload. E.g. background.js: | 273 // child usable from onload. E.g. background.js: |
| 271 // | 274 // |
| 272 // <code>function(createdWindow) { createdWindow.contentWindow.foo = | 275 // <code>function(createdWindow) { createdWindow.contentWindow.foo = |
| 273 // function () { }; };</code> | 276 // function () { }; };</code> |
| 274 // | 277 // |
| 275 // window.js: | 278 // window.js: |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 [nodoc] boolean? firstShowHasHappened; | 365 [nodoc] boolean? firstShowHasHappened; |
| 363 | 366 |
| 364 // Set whether the window should stay above most other windows. Requires the | 367 // Set whether the window should stay above most other windows. Requires the |
| 365 // <code>"alwaysOnTopWindows"</code> permission. | 368 // <code>"alwaysOnTopWindows"</code> permission. |
| 366 static void setAlwaysOnTop(boolean alwaysOnTop); | 369 static void setAlwaysOnTop(boolean alwaysOnTop); |
| 367 | 370 |
| 368 // Can the window use alpha transparency? | 371 // Can the window use alpha transparency? |
| 369 // TODO(jackhou): Document this properly before going to stable. | 372 // TODO(jackhou): Document this properly before going to stable. |
| 370 [nodoc] static boolean alphaEnabled(); | 373 [nodoc] static boolean alphaEnabled(); |
| 371 | 374 |
| 375 // For platforms that support multiple workspaces, is this window on all of | |
| 376 // them? | |
| 377 [nodoc] static void setVisibleOnAllWorkspaces(boolean alwaysVisible); | |
|
benwells
2014/08/20 05:02:08
Can you remove the [nodoc] and mention that this i
jackhou1
2014/08/27 05:10:45
Done.
| |
| 378 | |
| 379 // Does the current platform support windows being visible on all | |
| 380 // workspaces? | |
| 381 [nodoc] static boolean canSetVisibleOnAllWorkspaces(); | |
|
benwells
2014/08/20 05:02:08
I just realised this is on the AppWindow. Can we j
jackhou1
2014/08/27 05:10:45
Done.
| |
| 382 | |
| 372 // The JavaScript 'window' object for the created child. | 383 // The JavaScript 'window' object for the created child. |
| 373 [instanceOf=Window] object contentWindow; | 384 [instanceOf=Window] object contentWindow; |
| 374 | 385 |
| 375 // The id the window was created with. | 386 // The id the window was created with. |
| 376 DOMString id; | 387 DOMString id; |
| 377 | 388 |
| 378 // The position, size and constraints of the window's content, which does | 389 // The position, size and constraints of the window's content, which does |
| 379 // not include window decorations. | 390 // not include window decorations. |
| 380 // This property is new in Chrome 36. | 391 // This property is new in Chrome 36. |
| 381 Bounds innerBounds; | 392 Bounds innerBounds; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 // Fired when the window is restored from being minimized or maximized. | 462 // Fired when the window is restored from being minimized or maximized. |
| 452 [nocompile] static void onRestored(); | 463 [nocompile] static void onRestored(); |
| 453 | 464 |
| 454 // Fired when the window's ability to use alpha transparency changes. | 465 // Fired when the window's ability to use alpha transparency changes. |
| 455 [nocompile, nodoc] static void onAlphaEnabledChanged(); | 466 [nocompile, nodoc] static void onAlphaEnabledChanged(); |
| 456 | 467 |
| 457 // Event for testing. Lets tests wait until a window has been shown. | 468 // Event for testing. Lets tests wait until a window has been shown. |
| 458 [nocompile, nodoc] static void onWindowFirstShown(); | 469 [nocompile, nodoc] static void onWindowFirstShown(); |
| 459 }; | 470 }; |
| 460 }; | 471 }; |
| OLD | NEW |