Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // Next MinVersion: 11 | 5 // Next MinVersion: 12 |
| 6 | 6 |
| 7 module arc.mojom; | 7 module arc.mojom; |
| 8 | 8 |
| 9 import "scale_factor.mojom"; | 9 import "scale_factor.mojom"; |
| 10 | 10 |
| 11 // Describes the type of action to invoke. | 11 // Describes the type of action to invoke. |
| 12 enum ActionType { | 12 enum ActionType { |
| 13 VIEW, | 13 VIEW, |
| 14 SEND, | 14 SEND, |
| 15 SEND_MULTIPLE, | 15 SEND_MULTIPLE, |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 39 [MinVersion=10] array<AuthorityEntry>? data_authorities; | 39 [MinVersion=10] array<AuthorityEntry>? data_authorities; |
| 40 [MinVersion=10] array<PatternMatcher>? data_paths; | 40 [MinVersion=10] array<PatternMatcher>? data_paths; |
| 41 [MinVersion=10] array<PatternMatcher>? deprecated_data_scheme_specific_parts; | 41 [MinVersion=10] array<PatternMatcher>? deprecated_data_scheme_specific_parts; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Describes a package that can handle an intent. | 44 // Describes a package that can handle an intent. |
| 45 struct IntentHandlerInfo { | 45 struct IntentHandlerInfo { |
| 46 string name; | 46 string name; |
| 47 string package_name; | 47 string package_name; |
| 48 string activity_name; // A hint for retrieving the package's icon. | 48 string activity_name; // A hint for retrieving the package's icon. |
| 49 [MinVersion=4] ActionType action; | 49 [MinVersion=4] ActionType action_type; |
| 50 [MinVersion=6] bool is_preferred; | 50 [MinVersion=6] bool is_preferred; |
| 51 [MinVersion=11] string? action; // e.g. "android.intent.action.VIEW" | |
|
dcheng
2016/10/04 22:29:11
How will this field be used?
Daniel Erat
2016/10/04 22:43:22
i can document it in a comment if that'd be better
dcheng
2016/10/04 22:49:41
Usually, it's preferred to land this sort of chang
Daniel Erat
2016/10/04 22:57:35
got it. yeah, chrome can't use this until the andr
| |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 // Describes an activity. | 54 // Describes an activity. |
| 54 struct ActivityName { | 55 struct ActivityName { |
| 55 string package_name; | 56 string package_name; |
| 56 string activity_name; | 57 string activity_name; |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 // Describes an icon for the activity. | 60 // Describes an icon for the activity. |
| 60 struct ActivityIcon { | 61 struct ActivityIcon { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 // When multiple packages are set as preferred, the most recent setting wins. | 106 // When multiple packages are set as preferred, the most recent setting wins. |
| 106 [MinVersion=7] AddPreferredPackage@8(string package_name); | 107 [MinVersion=7] AddPreferredPackage@8(string package_name); |
| 107 | 108 |
| 108 // Handles the URL by sending an ACTION_VIEW intent to the package. The | 109 // Handles the URL by sending an ACTION_VIEW intent to the package. The |
| 109 // most suitable activity for the URL within the package will be started. | 110 // most suitable activity for the URL within the package will be started. |
| 110 [MinVersion=2] HandleUrl@2(string url, string package_name); | 111 [MinVersion=2] HandleUrl@2(string url, string package_name); |
| 111 | 112 |
| 112 // Handles the list of URLs by sending a specified intent to the handler. | 113 // Handles the list of URLs by sending a specified intent to the handler. |
| 113 [MinVersion=5] HandleUrlList@7(array<UrlWithMimeType> urls, | 114 [MinVersion=5] HandleUrlList@7(array<UrlWithMimeType> urls, |
| 114 ActivityName activity, | 115 ActivityName activity, |
| 115 ActionType action); | 116 ActionType action_type); |
| 116 | 117 |
| 117 // Deprecated. Use HandleUrlList. | 118 // Deprecated. Use HandleUrlList. |
| 118 [MinVersion=4] HandleUrlListDeprecated@5(array<UrlWithMimeType> urls, | 119 [MinVersion=4] HandleUrlListDeprecated@5(array<UrlWithMimeType> urls, |
| 119 string package_name, | 120 string package_name, |
| 120 ActionType action); | 121 ActionType action_type); |
| 121 | 122 |
| 122 // Establishes full-duplex communication with the host. | 123 // Establishes full-duplex communication with the host. |
| 123 Init@0(IntentHelperHost host_ptr); | 124 Init@0(IntentHelperHost host_ptr); |
| 124 | 125 |
| 125 // Requests 48dp * 48dp icons of the |activities| suitable for the | 126 // Requests 48dp * 48dp icons of the |activities| suitable for the |
| 126 // |scale_factor|. An array of icon data will be returned. | 127 // |scale_factor|. An array of icon data will be returned. |
| 127 [MinVersion=3] RequestActivityIcons@4(array<ActivityName> activities, | 128 [MinVersion=3] RequestActivityIcons@4(array<ActivityName> activities, |
| 128 ScaleFactor scale_factor) | 129 ScaleFactor scale_factor) |
| 129 => (array<ActivityIcon> icons); | 130 => (array<ActivityIcon> icons); |
| 130 | 131 |
| 131 // Requests a list of packages that can handle the URL. | 132 // Requests a list of packages that can handle the URL. |
| 132 [MinVersion=2] RequestUrlHandlerList@3(string url) | 133 [MinVersion=2] RequestUrlHandlerList@3(string url) |
| 133 => (array<IntentHandlerInfo> handlers); | 134 => (array<IntentHandlerInfo> handlers); |
| 134 | 135 |
| 135 // Requests a list of packages that can handle the list of files. | 136 // Requests a list of packages that can handle the list of files. |
| 136 [MinVersion=4] RequestUrlListHandlerList@6(array<UrlWithMimeType> urls) | 137 [MinVersion=4] RequestUrlListHandlerList@6(array<UrlWithMimeType> urls) |
| 137 => (array<IntentHandlerInfo> handlers); | 138 => (array<IntentHandlerInfo> handlers); |
| 138 | 139 |
| 139 // Send an Android broadcast message to the Android package and class | 140 // Send an Android broadcast message to the Android package and class |
| 140 // specified. Data can be sent as extras by including a JSON map string which | 141 // specified. Data can be sent as extras by including a JSON map string which |
| 141 // will be automatically converted to a bundle accessible by the receiver. | 142 // will be automatically converted to a bundle accessible by the receiver. |
| 142 // | 143 // |
| 143 // Note: Broadcasts can only be sent to whitelisted packages. Packages can be | 144 // Note: Broadcasts can only be sent to whitelisted packages. Packages can be |
| 144 // added to the whitelist in ArcBridgeService.java in the Android source. | 145 // added to the whitelist in ArcBridgeService.java in the Android source. |
| 145 [MinVersion=1] SendBroadcast@1(string action, | 146 [MinVersion=1] SendBroadcast@1(string action, |
| 146 string package_name, | 147 string package_name, |
| 147 string cls, | 148 string cls, |
| 148 string extras); | 149 string extras); |
| 149 }; | 150 }; |
| OLD | NEW |