| 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> module 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 |
| 9 [availability=23] |
| 5 namespace app.runtime { | 10 namespace app.runtime { |
| 6 | 11 |
| 7 [inline_doc] dictionary LaunchItem { | 12 [inline_doc] dictionary LaunchItem { |
| 8 // FileEntry for the file. | 13 // FileEntry for the file. |
| 9 [instanceOf=FileEntry] object entry; | 14 [instanceOf=FileEntry] object entry; |
| 10 | 15 |
| 11 // The MIME type of the file. | 16 // The MIME type of the file. |
| 12 DOMString type; | 17 DOMString type; |
| 13 }; | 18 }; |
| 14 | 19 |
| 15 // Optional data for the launch. | 20 // Optional data for the launch. |
| 16 [inline_doc] dictionary LaunchData { | 21 [inline_doc] dictionary LaunchData { |
| 17 // The id of the file handler that the app is being invoked with. | 22 // The id of the file handler that the app is being invoked with. |
| 18 DOMString? id; | 23 DOMString? id; |
| 19 | 24 |
| 20 LaunchItem[]? items; | 25 LaunchItem[]? items; |
| 21 }; | 26 }; |
| 22 | 27 |
| 23 interface Events { | 28 interface Events { |
| 24 // Fired when an app is launched from the launcher. | 29 // Fired when an app is launched from the launcher. |
| 25 static void onLaunched(optional LaunchData launchData); | 30 static void onLaunched(optional LaunchData launchData); |
| 26 | 31 |
| 27 // Fired at Chrome startup to apps that were running when Chrome last shut | 32 // Fired at Chrome startup to apps that were running when Chrome last shut |
| 28 // down. | 33 // down. |
| 29 static void onRestarted(); | 34 static void onRestarted(); |
| 30 }; | 35 }; |
| 31 }; | 36 }; |
| OLD | NEW |