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.
5 // Use the <code>chrome.app.runtime</code> API to manage the app lifecycle.
6 // The app runtime manages app installation, controls the event page, and can
7 // shut down the app at anytime.
8 namespace app.runtime
{
10 [inline_doc
] dictionary LaunchItem
{
11 // FileEntry for the file.
12 [instanceOf
=FileEntry
] object entry;
14 // The MIME type of the file.
18 // Optional data for the launch. Either <code>items</code>, or
19 // the pair (<code>url, referrerUrl</code>) can be present for any given
21 [inline_doc
] dictionary LaunchData
{
22 // The ID of the file or URL handler that the app is being invoked with.
23 // Handler IDs are the top-level keys in the <code>file_handlers</code>
24 // and/or <code>url_handlers</code> dictionaries in the manifest.
27 // The file entries for the <code>onLaunched</code> event triggered by a
28 // matching file handler in the <code>file_handlers</code> manifest key.
31 // The URL for the <code>onLaunched</code> event triggered by a matching
32 // URL handler in the <code>url_handlers</code> manifest key.
35 // The referrer URL for the <code>onLaunched</code> event triggered by a
36 // matching URL handler in the <code>url_handlers</code> manifest key.
37 DOMString? referrerUrl
;
39 // Whether the app is being launched in a <a
40 // href="https://support.google.com/chromebook/answer/3134673">Chrome OS
42 boolean? isKioskSession
;
45 // This object specifies details and operations to perform on the embedding
46 // request. The app to be embedded can make a decision on whether or not to
47 // allow the embedding and what to embed based on the embedder making the
49 dictionary EmbedRequest
{
52 // Optional developer specified data that the app to be embedded can use
53 // when making an embedding decision.
56 // Allows <code>embedderId</code> to embed this app in an <appview>
57 // element. The <code>url</code> specifies the content to embed.
58 [nocompile
] static
void allow
(DOMString url
);
60 // Prevents <code> embedderId</code> from embedding this app in an
61 // <appview> element.
62 [nocompile
] static
void deny
();
66 // Fired when an embedding app requests to embed this app. This event is
67 // only available on dev channel with the flag --enable-app-view.
68 static
void onEmbedRequested
(EmbedRequest request
);
70 // Fired when an app is launched from the launcher.
71 static
void onLaunched
(optional LaunchData launchData
);
73 // Fired at Chrome startup to apps that were running when Chrome last shut
75 static
void onRestarted
();