Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Use the <code>chrome.shell</code> API to watch for launch events and create | |
|
James Cook
2014/04/28 21:04:19
I'm also planning to add an onLaunched event to th
| |
| 6 // windows. The createWindow API is a subset of | |
|
Yoyo Zhou
2014/04/29 22:10:00
<code>createWindow</code>
James Cook
2014/04/29 22:53:52
Done.
| |
| 7 // <code>chrome.app.window.create</code>. | |
| 8 namespace shell { | |
| 9 | |
| 10 [noinline_doc] dictionary CreateWindowOptions { | |
| 11 // Stub for the id of a window. This parameter is ignored in app_shell but | |
| 12 // provided for compatibility with apps running in Chrome. | |
| 13 DOMString? id; | |
| 14 | |
| 15 // Stubs for the bounds of a window. These parameters are ignored in | |
| 16 // app_shell but are provided for compatibility with apps running in Chrome. | |
|
Yoyo Zhou
2014/04/29 22:10:00
nit: change this . to a semicolon.
James Cook
2014/04/29 22:53:52
Done.
| |
| 17 // The created window will always fill the root window of the default | |
| 18 // display. | |
| 19 object? innerBounds; | |
| 20 object? outerBounds; | |
| 21 }; | |
| 22 | |
| 23 // Called in the creating window (parent) before the load event is called in | |
| 24 // the created window (child). The parent can set fields or functions on the | |
| 25 // child usable from onload. E.g. background.js:<br> | |
| 26 // <code>function(createdWindow) { createdWindow.contentWindow.foo = | |
| 27 // function () { }; };</code> | |
| 28 // <br>window.js:<br> | |
| 29 // <code>window.onload = function () { foo(); }</code> | |
| 30 callback CreateWindowCallback = | |
| 31 void ([instanceOf=AppWindow] object createdWindow); | |
| 32 | |
| 33 [noinline_doc] dictionary AppWindow { | |
| 34 // The JavaScript 'window' object for the created child. | |
| 35 [instanceOf=Window] object contentWindow; | |
| 36 }; | |
| 37 | |
| 38 interface Functions { | |
| 39 // Creates a fullscreen window on the default display. Options for id and | |
| 40 // bounds are ignored. | |
| 41 static void createWindow(DOMString url, | |
| 42 optional CreateWindowOptions options, | |
| 43 optional CreateWindowCallback callback); | |
| 44 | |
| 45 // Returns an $(ref:AppWindow) object for the current script context | |
| 46 // (i.e. JavaScript 'window' object). | |
| 47 [nocompile] static AppWindow currentWindow(); | |
| 48 [nocompile, nodoc] static void initializeAppWindow(); | |
| 49 }; | |
| 50 }; | |
| OLD | NEW |