OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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.runtime</code> API to manage the app lifecycle. | 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 | 6 // The app runtime manages app installation, controls the event page, and can |
7 // shut down the app at anytime. | 7 // shut down the app at anytime. |
8 namespace app.runtime { | 8 namespace app.runtime { |
9 | 9 |
10 [inline_doc] dictionary LaunchItem { | 10 [inline_doc] dictionary LaunchItem { |
11 // FileEntry for the file. | 11 // FileEntry for the file. |
12 [instanceOf=FileEntry] object entry; | 12 [instanceOf=FileEntry] object entry; |
13 | 13 |
14 // The MIME type of the file. | 14 // The MIME type of the file. |
15 DOMString type; | 15 DOMString type; |
16 }; | 16 }; |
17 | 17 |
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 file_handler, | |
26 url_handler, | |
27 | |
28 athena, | |
29 win_metro, | |
30 | |
31 // App-specific | |
benwells
2014/10/28 21:22:48
We should remove the "App-specific" comment.
cylee1
2014/10/29 16:40:00
Done.
| |
32 system_tray, | |
33 about_page, | |
34 keyboard | |
35 }; | |
36 | |
18 // Optional data for the launch. Either <code>items</code>, or | 37 // Optional data for the launch. Either <code>items</code>, or |
19 // the pair (<code>url, referrerUrl</code>) can be present for any given | 38 // the pair (<code>url, referrerUrl</code>) can be present for any given |
20 // launch. | 39 // launch. |
21 [inline_doc] dictionary LaunchData { | 40 [inline_doc] dictionary LaunchData { |
22 // The ID of the file or URL handler that the app is being invoked with. | 41 // 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> | 42 // Handler IDs are the top-level keys in the <code>file_handlers</code> |
24 // and/or <code>url_handlers</code> dictionaries in the manifest. | 43 // and/or <code>url_handlers</code> dictionaries in the manifest. |
25 DOMString? id; | 44 DOMString? id; |
26 | 45 |
27 // The file entries for the <code>onLaunched</code> event triggered by a | 46 // The file entries for the <code>onLaunched</code> event triggered by a |
28 // matching file handler in the <code>file_handlers</code> manifest key. | 47 // matching file handler in the <code>file_handlers</code> manifest key. |
29 LaunchItem[]? items; | 48 LaunchItem[]? items; |
30 | 49 |
31 // The URL for the <code>onLaunched</code> event triggered by a matching | 50 // The URL for the <code>onLaunched</code> event triggered by a matching |
32 // URL handler in the <code>url_handlers</code> manifest key. | 51 // URL handler in the <code>url_handlers</code> manifest key. |
33 DOMString? url; | 52 DOMString? url; |
34 | 53 |
35 // The referrer URL for the <code>onLaunched</code> event triggered by a | 54 // The referrer URL for the <code>onLaunched</code> event triggered by a |
36 // matching URL handler in the <code>url_handlers</code> manifest key. | 55 // matching URL handler in the <code>url_handlers</code> manifest key. |
37 DOMString? referrerUrl; | 56 DOMString? referrerUrl; |
38 | 57 |
39 // Whether the app is being launched in a <a | 58 // Whether the app is being launched in a <a |
40 // href="https://support.google.com/chromebook/answer/3134673">Chrome OS | 59 // href="https://support.google.com/chromebook/answer/3134673">Chrome OS |
41 // kiosk session</a>. | 60 // kiosk session</a>. |
42 boolean? isKioskSession; | 61 boolean? isKioskSession; |
62 | |
63 // Where the app is launched from. | |
64 LaunchSource? source; | |
43 }; | 65 }; |
44 | 66 |
45 // This object specifies details and operations to perform on the embedding | 67 // 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 | 68 // 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 | 69 // allow the embedding and what to embed based on the embedder making the |
48 // request. | 70 // request. |
49 dictionary EmbedRequest { | 71 dictionary EmbedRequest { |
50 DOMString embedderId; | 72 DOMString embedderId; |
51 | 73 |
52 // Optional developer specified data that the app to be embedded can use | 74 // Optional developer specified data that the app to be embedded can use |
(...skipping 15 matching lines...) Expand all Loading... | |
68 static void onEmbedRequested(EmbedRequest request); | 90 static void onEmbedRequested(EmbedRequest request); |
69 | 91 |
70 // Fired when an app is launched from the launcher. | 92 // Fired when an app is launched from the launcher. |
71 static void onLaunched(optional LaunchData launchData); | 93 static void onLaunched(optional LaunchData launchData); |
72 | 94 |
73 // Fired at Chrome startup to apps that were running when Chrome last shut | 95 // Fired at Chrome startup to apps that were running when Chrome last shut |
74 // down. | 96 // down. |
75 static void onRestarted(); | 97 static void onRestarted(); |
76 }; | 98 }; |
77 }; | 99 }; |
OLD | NEW |