Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / extensions / common / api / app_runtime.idl
blobf729347912464611ed81482b9f6bc636bada63da
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.
15 DOMString type;
18 // Enumeration of app launch sources.
19 enum LaunchSource {
20 app_launcher,
21 new_tab_page,
22 reload,
23 restart,
24 load_and_launch,
25 command_line,
26 file_handler,
27 url_handler,
28 system_tray,
29 about_page,
30 keyboard,
31 extensions_page,
32 management_api,
33 ephemeral_app,
34 background,
35 kiosk,
36 chrome_internal
39 // Optional data for the launch. Either <code>items</code>, or
40 // the pair (<code>url, referrerUrl</code>) can be present for any given
41 // launch.
42 [inline_doc] dictionary LaunchData {
43 // The ID of the file or URL handler that the app is being invoked with.
44 // Handler IDs are the top-level keys in the <code>file_handlers</code>
45 // and/or <code>url_handlers</code> dictionaries in the manifest.
46 DOMString? id;
48 // The file entries for the <code>onLaunched</code> event triggered by a
49 // matching file handler in the <code>file_handlers</code> manifest key.
50 LaunchItem[]? items;
52 // The URL for the <code>onLaunched</code> event triggered by a matching
53 // URL handler in the <code>url_handlers</code> manifest key.
54 DOMString? url;
56 // The referrer URL for the <code>onLaunched</code> event triggered by a
57 // matching URL handler in the <code>url_handlers</code> manifest key.
58 DOMString? referrerUrl;
60 // Whether the app is being launched in a <a
61 // href="https://support.google.com/chromebook/answer/3134673">Chrome OS
62 // kiosk session</a>.
63 boolean? isKioskSession;
65 // Where the app is launched from.
66 LaunchSource? source;
69 // This object specifies details and operations to perform on the embedding
70 // request. The app to be embedded can make a decision on whether or not to
71 // allow the embedding and what to embed based on the embedder making the
72 // request.
73 dictionary EmbedRequest {
74 DOMString embedderId;
76 // Optional developer specified data that the app to be embedded can use
77 // when making an embedding decision.
78 any? data;
80 // Allows <code>embedderId</code> to embed this app in an &lt;appview&gt;
81 // element. The <code>url</code> specifies the content to embed.
82 [nocompile] static void allow(DOMString url);
84 // Prevents <code> embedderId</code> from embedding this app in an
85 // &lt;appview&gt; element.
86 [nocompile] static void deny();
89 interface Events {
90 // Fired when an embedding app requests to embed this app. This event is
91 // only available on dev channel with the flag --enable-app-view.
92 static void onEmbedRequested(EmbedRequest request);
94 // Fired when an app is launched from the launcher.
95 static void onLaunched(optional LaunchData launchData);
97 // Fired at Chrome startup to apps that were running when Chrome last shut
98 // down, or when apps have been requested to restart from their previous
99 // state for other reasons (e.g. when the user revokes access to an app's
100 // retained files the runtime will restart the app). In these situations if
101 // apps do not have an <code>onRestarted</code> handler they will be sent
102 // an <code>onLaunched </code> event instead.
103 static void onRestarted();