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. The type of action the app was launched | |
| 43 // with is available inside of the |actionData| field from the LaunchData | |
| 44 // instance. | |
| 45 enum ActionType { | |
| 46 // The user wants to quickly take a new note. | |
| 47 new_note | |
| 48 }; | |
| 49 | |
| 50 // Optional data that includes action-specific launch information. | |
| 51 dictionary ActionData { | |
| 52 ActionType actionType; | |
| 53 }; | |
| 54 | |
| 41 // Optional data for the launch. Either <code>items</code>, or | 55 // Optional data for the launch. Either <code>items</code>, or |
| 42 // the pair (<code>url, referrerUrl</code>) can be present for any given | 56 // the pair (<code>url, referrerUrl</code>) can be present for any given |
| 43 // launch. | 57 // launch. |
| 44 [inline_doc] dictionary LaunchData { | 58 [inline_doc] dictionary LaunchData { |
| 45 // The ID of the file or URL handler that the app is being invoked with. | 59 // 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> | 60 // Handler IDs are the top-level keys in the <code>file_handlers</code> |
| 47 // and/or <code>url_handlers</code> dictionaries in the manifest. | 61 // and/or <code>url_handlers</code> dictionaries in the manifest. |
| 48 DOMString? id; | 62 DOMString? id; |
| 49 | 63 |
| 50 // The file entries for the <code>onLaunched</code> event triggered by a | 64 // The file entries for the <code>onLaunched</code> event triggered by a |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 64 // kiosk session</a>. | 78 // kiosk session</a>. |
| 65 boolean? isKioskSession; | 79 boolean? isKioskSession; |
| 66 | 80 |
| 67 // Whether the app is being launched in a <a | 81 // Whether the app is being launched in a <a |
| 68 // href="https://support.google.com/chrome/a/answer/3017014">Chrome OS | 82 // href="https://support.google.com/chrome/a/answer/3017014">Chrome OS |
| 69 // public session</a>. | 83 // public session</a>. |
| 70 boolean? isPublicSession; | 84 boolean? isPublicSession; |
| 71 | 85 |
| 72 // Where the app is launched from. | 86 // Where the app is launched from. |
| 73 LaunchSource? source; | 87 LaunchSource? source; |
| 88 | |
| 89 // Contains data that specifies what the <code>ActionType</code> this app | |
|
Devlin
2016/08/16 00:20:09
remove "what"
jdufault
2016/08/16 21:30:57
Done.
| |
| 90 // was launched with. This is null if the app was not launched with a | |
| 91 // specific action in mind. | |
|
Devlin
2016/08/16 00:20:09
"in mind" is kind of weird phrasing here. Maybe s
jdufault
2016/08/16 21:30:57
Done.
| |
| 92 ActionData? actionData; | |
| 74 }; | 93 }; |
| 75 | 94 |
| 76 // This object specifies details and operations to perform on the embedding | 95 // 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 | 96 // 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 | 97 // allow the embedding and what to embed based on the embedder making the |
| 79 // request. | 98 // request. |
| 80 dictionary EmbedRequest { | 99 dictionary EmbedRequest { |
| 81 DOMString embedderId; | 100 DOMString embedderId; |
| 82 | 101 |
| 83 // Optional developer specified data that the app to be embedded can use | 102 // Optional developer specified data that the app to be embedded can use |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 103 | 122 |
| 104 // Fired at Chrome startup to apps that were running when Chrome last shut | 123 // 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 | 124 // 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 | 125 // 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 | 126 // 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 | 127 // apps do not have an <code>onRestarted</code> handler they will be sent |
| 109 // an <code>onLaunched </code> event instead. | 128 // an <code>onLaunched </code> event instead. |
| 110 static void onRestarted(); | 129 static void onRestarted(); |
| 111 }; | 130 }; |
| 112 }; | 131 }; |
| OLD | NEW |