Chromium Code Reviews| 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 { |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 extensions_page, | 31 extensions_page, |
| 32 management_api, | 32 management_api, |
| 33 ephemeral_app, | 33 ephemeral_app, |
| 34 background, | 34 background, |
| 35 kiosk, | 35 kiosk, |
| 36 chrome_internal, | 36 chrome_internal, |
| 37 test, | 37 test, |
| 38 installed_notification | 38 installed_notification |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 // An app can be launched with a specific action in mind, for example, to | |
| 42 // create a new note. If action data is present, a special UI should be shown | |
|
Devlin
2016/08/11 20:51:21
Do we need to dictate that a "special UI should be
jdufault
2016/08/12 18:56:55
Done.
| |
| 43 // that is optimized for the flow. The type of action the app was launched | |
| 44 // with is available inside of the |action_data| field from the LaunchData | |
|
Devlin
2016/08/11 20:51:21
actionData
jdufault
2016/08/12 18:56:55
Done.
| |
| 45 // instance. | |
| 46 enum ActionType { | |
| 47 // The user wants to quickly take a new note. | |
| 48 new_note | |
| 49 }; | |
| 50 | |
| 51 // Specifies the <code>ActionType</code> the app was launched with. | |
|
Devlin
2016/08/11 20:51:21
This should go over actionType, rather than here.
jdufault
2016/08/12 18:56:55
Done.
| |
| 52 dictionary ActionData { | |
| 53 ActionType action_type; | |
|
Devlin
2016/08/11 20:51:21
actionType
jdufault
2016/08/12 18:56:55
Done.
| |
| 54 }; | |
| 55 | |
| 41 // Optional data for the launch. Either <code>items</code>, or | 56 // Optional data for the launch. Either <code>items</code>, or |
| 42 // the pair (<code>url, referrerUrl</code>) can be present for any given | 57 // the pair (<code>url, referrerUrl</code>) can be present for any given |
| 43 // launch. | 58 // launch. |
| 44 [inline_doc] dictionary LaunchData { | 59 [inline_doc] dictionary LaunchData { |
| 45 // The ID of the file or URL handler that the app is being invoked with. | 60 // The ID of the file or URL handler that the app is being invoked with. |
| 46 // Handler IDs are the top-level keys in the <code>file_handlers</code> | 61 // Handler IDs are the top-level keys in the <code>file_handlers</code> |
| 47 // and/or <code>url_handlers</code> dictionaries in the manifest. | 62 // and/or <code>url_handlers</code> dictionaries in the manifest. |
| 48 DOMString? id; | 63 DOMString? id; |
| 49 | 64 |
| 50 // The file entries for the <code>onLaunched</code> event triggered by a | 65 // The file entries for the <code>onLaunched</code> event triggered by a |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 64 // kiosk session</a>. | 79 // kiosk session</a>. |
| 65 boolean? isKioskSession; | 80 boolean? isKioskSession; |
| 66 | 81 |
| 67 // Whether the app is being launched in a <a | 82 // Whether the app is being launched in a <a |
| 68 // href="https://support.google.com/chrome/a/answer/3017014">Chrome OS | 83 // href="https://support.google.com/chrome/a/answer/3017014">Chrome OS |
| 69 // public session</a>. | 84 // public session</a>. |
| 70 boolean? isPublicSession; | 85 boolean? isPublicSession; |
| 71 | 86 |
| 72 // Where the app is launched from. | 87 // Where the app is launched from. |
| 73 LaunchSource? source; | 88 LaunchSource? source; |
| 89 | |
| 90 // Contains data that specifies what type of action this app was launched | |
| 91 // with. This is null if the app was not launched with a specific action in | |
| 92 // mind. | |
| 93 ActionData? action_data; | |
|
Devlin
2016/08/11 20:51:21
actionData
jdufault
2016/08/12 18:56:55
Done.
| |
| 74 }; | 94 }; |
| 75 | 95 |
| 76 // This object specifies details and operations to perform on the embedding | 96 // This object specifies details and operations to perform on the embedding |
| 77 // request. The app to be embedded can make a decision on whether or not to | 97 // request. The app to be embedded can make a decision on whether or not to |
| 78 // allow the embedding and what to embed based on the embedder making the | 98 // allow the embedding and what to embed based on the embedder making the |
| 79 // request. | 99 // request. |
| 80 dictionary EmbedRequest { | 100 dictionary EmbedRequest { |
| 81 DOMString embedderId; | 101 DOMString embedderId; |
| 82 | 102 |
| 83 // Optional developer specified data that the app to be embedded can use | 103 // Optional developer specified data that the app to be embedded can use |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 103 | 123 |
| 104 // Fired at Chrome startup to apps that were running when Chrome last shut | 124 // Fired at Chrome startup to apps that were running when Chrome last shut |
| 105 // down, or when apps have been requested to restart from their previous | 125 // down, or when apps have been requested to restart from their previous |
| 106 // state for other reasons (e.g. when the user revokes access to an app's | 126 // state for other reasons (e.g. when the user revokes access to an app's |
| 107 // retained files the runtime will restart the app). In these situations if | 127 // retained files the runtime will restart the app). In these situations if |
| 108 // apps do not have an <code>onRestarted</code> handler they will be sent | 128 // apps do not have an <code>onRestarted</code> handler they will be sent |
| 109 // an <code>onLaunched </code> event instead. | 129 // an <code>onLaunched </code> event instead. |
| 110 static void onRestarted(); | 130 static void onRestarted(); |
| 111 }; | 131 }; |
| 112 }; | 132 }; |
| OLD | NEW |