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.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 // Optional data for the launch. Either <code>items</code>, or | 18 // Optional data for the launch. |
19 // the pair (<code>url, referrerUrl</code>) can be present for any given | |
20 // launch. | |
21 [inline_doc] dictionary LaunchData { | 19 [inline_doc] dictionary LaunchData { |
22 // The ID of the file or URL handler that the app is being invoked with. | 20 // The id of the file 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. | |
25 DOMString? id; | 21 DOMString? id; |
26 | 22 |
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. | |
29 LaunchItem[]? items; | 23 LaunchItem[]? items; |
30 | |
31 // The URL for the <code>onLaunched</code> event triggered by a matching | |
32 // URL handler in the <code>url_handlers</code> manifest key. | |
33 DOMString? url; | |
34 | |
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; | |
38 }; | 24 }; |
39 | 25 |
40 interface Events { | 26 interface Events { |
41 // Fired when an app is launched from the launcher. | 27 // Fired when an app is launched from the launcher. |
42 static void onLaunched(optional LaunchData launchData); | 28 static void onLaunched(optional LaunchData launchData); |
43 | 29 |
44 // Fired at Chrome startup to apps that were running when Chrome last shut | 30 // Fired at Chrome startup to apps that were running when Chrome last shut |
45 // down. | 31 // down. |
46 static void onRestarted(); | 32 static void onRestarted(); |
47 }; | 33 }; |
48 }; | 34 }; |
OLD | NEW |