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 module arc; | 5 module arc; |
6 | 6 |
| 7 // Describes a package that can handle a URL. |
| 8 struct UrlHandlerInfo { |
| 9 string name; |
| 10 string package_name; |
| 11 string activity_name; // A hint for retrieving the package's icon. |
| 12 }; |
| 13 |
7 // Handles intents from ARC in Chrome. | 14 // Handles intents from ARC in Chrome. |
8 interface IntentHelperHost { | 15 interface IntentHelperHost { |
9 // Opens the url with Chrome for Chrome OS. | 16 // Opens the url with Chrome for Chrome OS. |
10 OnOpenUrl@0(string url); | 17 OnOpenUrl@0(string url); |
11 }; | 18 }; |
12 | 19 |
13 // Sends intents to ARC on behalf of Chrome. | 20 // Sends intents to ARC on behalf of Chrome. |
14 interface IntentHelperInstance { | 21 interface IntentHelperInstance { |
| 22 // Handles the URL by sending an ACTION_VIEW intent to the package. The |
| 23 // most suitable activity for the URL within the package will be started. |
| 24 [MinVersion=2] HandleUrl@2(string url, string package_name); |
| 25 |
15 // Establishes full-duplex communication with the host. | 26 // Establishes full-duplex communication with the host. |
16 Init@0(IntentHelperHost host_ptr); | 27 Init@0(IntentHelperHost host_ptr); |
17 | 28 |
| 29 // Requests a list of packages that can handle the URL. |
| 30 [MinVersion=2] RequestUrlHandlerList@3(string url) |
| 31 => (array<UrlHandlerInfo> handlers); |
| 32 |
18 // Send an Android broadcast message to the Android package and class | 33 // Send an Android broadcast message to the Android package and class |
19 // specified. Data can be sent as extras by including a JSON map string which | 34 // specified. Data can be sent as extras by including a JSON map string which |
20 // will be automatically converted to a bundle accessible by the receiver. | 35 // will be automatically converted to a bundle accessible by the receiver. |
21 // | 36 // |
22 // Note: Broadcasts can only be sent to whitelisted packages. Packages can be | 37 // Note: Broadcasts can only be sent to whitelisted packages. Packages can be |
23 // added to the whitelist in ArcBridgeService.java in the Android source. | 38 // added to the whitelist in ArcBridgeService.java in the Android source. |
24 [MinVersion=1] SendBroadcast@1(string action, | 39 [MinVersion=1] SendBroadcast@1(string action, |
25 string package_name, | 40 string package_name, |
26 string cls, | 41 string cls, |
27 string extras); | 42 string extras); |
28 }; | 43 }; |
OLD | NEW |