OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module arc; | |
6 | |
7 // These values must be matched with the NOTIFICATION_EVENT_* constants in | |
8 // com.android.server.ArcNotificationListenerService. | |
9 enum ArcNotificationEvent { | |
10 BODY_CLICKED = 0, | |
11 CLOSED = 1, | |
12 // Five buttons at maximum (message_center::kNotificationMaximumItems = 5). | |
13 BUTTON1_CLICKED = 2, | |
14 BUTTON2_CLICKED = 3, | |
15 BUTTON3_CLICKED = 4, | |
16 BUTTON4_CLICKED = 5, | |
17 BUTTON5_CLICKED = 6, | |
18 }; | |
19 | |
20 // These values must be matched with the NOTIFICATION_TYPE_* constants in | |
21 // com.android.server.ArcNotificationListenerService. | |
22 enum ArcNotificationType { | |
23 BASIC = 0, | |
24 IMAGE = 1, | |
25 PROGRESS = 2, | |
26 }; | |
27 | |
28 struct ArcNotificationData { | |
29 // Identifier of notification | |
30 string key; | |
31 // Type of notification | |
32 ArcNotificationType type; | |
33 // Body message of notification | |
34 string message; | |
35 // Title of notification | |
36 string title; | |
37 // Mimetype of |icon_data| | |
38 string icon_mimetype; | |
39 // Binary data of the icon | |
40 array<uint8> icon_data; | |
41 // Priority of notification, must be [2,-2] | |
42 int32 priority; | |
43 // Timestamp related to the notification | |
44 int64 time; | |
45 // The current value of progress, must be [0, progress_max]. | |
46 int32 progress_current; | |
47 // The maximum value of progress. | |
48 int32 progress_max; | |
49 }; | |
50 | |
51 interface NotificationsHost { | |
52 // Tells the Chrome that a notification is posted (created or updated) on | |
53 // Android. | |
54 // |notification_data| is the data of notification (id, texts, icon and ...). | |
55 OnNotificationPosted(ArcNotificationData notification_data); | |
56 | |
57 // Notifies that a notification is removed on Android. | |
58 // |key| is the identifier of the notification. | |
59 OnNotificationRemoved(string key); | |
60 }; | |
61 | |
62 // TODO(lhchavez): Migrate all request/response messages to Mojo. | |
63 interface NotificationsInstance { | |
64 // Establishes full-duplex communication with the host. | |
65 Init(NotificationsHost host_ptr); | |
elijahtaylor1
2015/12/16 19:19:52
I don't see where this is called in other code, ha
Luis Héctor Chávez
2015/12/17 22:38:03
Probably yoshiki@.
| |
66 | |
67 // Sends an event from Chrome notification UI to Android. | |
68 // |event| is a type of occured event. | |
69 SendNotificationEventToAndroid(string key, ArcNotificationEvent event); | |
70 }; | |
OLD | NEW |