1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Next MinVersion: 16
module arc.mojom;
import "scale_factor.mojom";
// Describes the type of action to invoke.
enum ActionType {
VIEW,
SEND,
SEND_MULTIPLE,
};
[Extensible]
enum PatternType {
PATTERN_LITERAL,
PATTERN_PREFIX,
PATTERN_SIMPLE_GLOB,
};
struct PatternMatcher {
string pattern;
PatternType type;
};
struct AuthorityEntry {
string host;
int32 port;
};
struct IntentInfo {
string action;
array<string>? categories;
string? data; // URI
string? type; // explicit MIME type for data
[MinVersion=13] string? clip_data_uri; // optional URI to provide as ClipData
};
struct IntentFilter {
array<string> actions;
array<string> categories;
array<string> data_schemes;
[MinVersion=10] array<AuthorityEntry>? data_authorities;
[MinVersion=10] array<PatternMatcher>? data_paths;
[MinVersion=10] array<PatternMatcher>? deprecated_data_scheme_specific_parts;
};
// Describes a package that can handle an intent.
struct IntentHandlerInfo {
string name;
string package_name;
string activity_name; // A hint for retrieving the package's icon.
[MinVersion=4] ActionType action_type;
[MinVersion=6] bool is_preferred;
[MinVersion=11] string? action; // e.g. "android.intent.action.VIEW"
// RequestUrlHandlerList may fill |fallback_url| when it is called with an
// intent: URL.
[MinVersion=14] string? fallback_url;
};
// Describes an activity.
struct ActivityName {
string package_name;
string? activity_name; // may be null to indicate any activity within package
};
// Describes an icon for the activity.
struct ActivityIcon {
ActivityName activity;
uint32 width; // in px
uint32 height; // in px
array<uint8> icon; // in BGRA8888 format
};
// URL associated with its mime type.
struct UrlWithMimeType {
string url;
string mime_type;
};
// Handles intents from ARC in Chrome.
// Deprecated method ID: 4
// Next method ID: 6
interface IntentHelperHost {
// Called when icons associated with the package are no longer up to date.
[MinVersion=3] OnIconInvalidated@1(string package_name);
// Called when intent filters are updated. Either on startup or when
// apps are installed or uninstalled.
[MinVersion=9] OnIntentFiltersUpdated@5(array<IntentFilter> intent_filters);
// Opens the downloads directory in the Chrome OS file manager.
[MinVersion=5] OnOpenDownloads@2();
// Opens the url with Chrome for Chrome OS.
OnOpenUrl@0(string url);
// Opens the wallpaper picker dialog.
[MinVersion=6] OpenWallpaperPicker@3();
// Sets an image as the wallpaper.
// |jpeg_data| is a JPEG encoded wallpaper image.
[MinVersion=8] SetWallpaperDeprecated@4(array<uint8> jpeg_data);
};
// Sends intents to ARC on behalf of Chrome.
// Next method ID: 13
interface IntentHelperInstance {
// Sets the given package as a preferred package. The next time an ACTION_VIEW
// intent is sent with a URL that requires disambiguation, instead of opening
// the ResolverActivity, this package will be picked if it is on the list.
// When multiple packages are set as preferred, the most recent setting wins.
[MinVersion=7] AddPreferredPackage@8(string package_name);
// DEPRECATED. Use FileSystemInstance.GetFileSize() instead.
[MinVersion=15] GetFileSizeDeprecated@11(string url) => (int64 size);
// Passes an intent to an activity.
[MinVersion=12] HandleIntent@10(IntentInfo intent, ActivityName activity);
// Handles the URL by sending an ACTION_VIEW intent to the package. The
// most suitable activity for the URL within the package will be started.
[MinVersion=2] HandleUrl@2(string url, string package_name);
// Handles the list of URLs by sending a specified intent to the handler.
[MinVersion=5] HandleUrlList@7(array<UrlWithMimeType> urls,
ActivityName activity,
ActionType action_type);
// Establishes full-duplex communication with the host.
Init@0(IntentHelperHost host_ptr);
// DEPRECATED. Use FileSystemInstance.OpenFileToRead() instead.
[MinVersion=15] OpenFileToReadDeprecated@12(string url) => (handle? fd);
// Requests 48dp * 48dp icons of the |activities| suitable for the
// |scale_factor|. An array of icon data will be returned.
[MinVersion=3] RequestActivityIcons@4(array<ActivityName> activities,
ScaleFactor scale_factor)
=> (array<ActivityIcon> icons);
// Requests a list of packages that can handle |intent|.
[MinVersion=12] RequestIntentHandlerList@9(IntentInfo intent)
=> (array<IntentHandlerInfo> handlers);
// Requests a list of packages that can handle the URL.
[MinVersion=2] RequestUrlHandlerList@3(string url)
=> (array<IntentHandlerInfo> handlers);
// Requests a list of packages that can handle the list of files.
[MinVersion=4] RequestUrlListHandlerList@6(array<UrlWithMimeType> urls)
=> (array<IntentHandlerInfo> handlers);
// Send an Android broadcast message to the Android package and class
// specified. Data can be sent as extras by including a JSON map string which
// will be automatically converted to a bundle accessible by the receiver.
//
// Note: Broadcasts can only be sent to whitelisted packages. Packages can be
// added to the whitelist in ArcBridgeService.java in the Android source.
[MinVersion=1] SendBroadcast@1(string action,
string package_name,
string cls,
string extras);
};
|