| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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.mojom; | 5 module arc.mojom; |
| 6 | 6 |
| 7 import "bitmap.mojom"; |
| 8 |
| 7 // These values must be matched with the NOTIFICATION_EVENT_* constants in | 9 // These values must be matched with the NOTIFICATION_EVENT_* constants in |
| 8 // com.android.server.ArcNotificationListenerService. | 10 // com.android.server.ArcNotificationListenerService. |
| 9 enum ArcNotificationEvent { | 11 enum ArcNotificationEvent { |
| 10 BODY_CLICKED = 0, | 12 BODY_CLICKED = 0, |
| 11 CLOSED = 1, | 13 CLOSED = 1, |
| 12 // Five buttons at maximum (message_center::kNotificationMaximumItems = 5). | 14 // Five buttons at maximum (message_center::kNotificationMaximumItems = 5). |
| 13 BUTTON_1_CLICKED = 2, | 15 BUTTON_1_CLICKED = 2, |
| 14 BUTTON_2_CLICKED = 3, | 16 BUTTON_2_CLICKED = 3, |
| 15 BUTTON_3_CLICKED = 4, | 17 BUTTON_3_CLICKED = 4, |
| 16 BUTTON_4_CLICKED = 5, | 18 BUTTON_4_CLICKED = 5, |
| 17 BUTTON_5_CLICKED = 6, | 19 BUTTON_5_CLICKED = 6, |
| 18 MAX = BUTTON_5_CLICKED | |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 // These values must be matched with the NOTIFICATION_TYPE_* constants in | 22 // These values must be matched with the NOTIFICATION_TYPE_* constants in |
| 22 // com.android.server.ArcNotificationListenerService. | 23 // com.android.server.ArcNotificationListenerService. |
| 23 enum ArcNotificationType { | 24 enum ArcNotificationType { |
| 24 BASIC = 0, | 25 BASIC = 0, |
| 25 IMAGE = 1, | 26 IMAGE = 1, |
| 26 PROGRESS = 2, | 27 PROGRESS = 2, |
| 27 MAX = PROGRESS | 28 LIST = 3, |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 struct ArcNotificationButton { | 31 struct ArcNotificationButton { |
| 31 // Title | 32 // Title |
| 32 string label; | 33 string label; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 struct ArcNotificationData { | 36 struct ArcNotificationData { |
| 36 // Identifier of notification | 37 // Identifier of notification |
| 37 string key; | 38 string key; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 // The maximum value of progress. | 55 // The maximum value of progress. |
| 55 int32 progress_max; | 56 int32 progress_max; |
| 56 // Action buttons | 57 // Action buttons |
| 57 array<ArcNotificationButton> buttons; | 58 array<ArcNotificationButton> buttons; |
| 58 // Flag if the notification has FLAG_NO_CLEAR. | 59 // Flag if the notification has FLAG_NO_CLEAR. |
| 59 [MinVersion=1] | 60 [MinVersion=1] |
| 60 bool no_clear; | 61 bool no_clear; |
| 61 // Flag if the notification has FLAG_ONGOING_EVENT. | 62 // Flag if the notification has FLAG_ONGOING_EVENT. |
| 62 [MinVersion=1] | 63 [MinVersion=1] |
| 63 bool ongoing_event; | 64 bool ongoing_event; |
| 65 // Subtexts for list notifications. |
| 66 [MinVersion=3] |
| 67 array<string>? texts; |
| 68 // Image for image notifications. |
| 69 [MinVersion=3] |
| 70 ArcBitmap? big_picture; |
| 64 }; | 71 }; |
| 65 | 72 |
| 66 [MinVersion=2] | 73 [MinVersion=2] |
| 67 struct ArcToastData { | 74 struct ArcToastData { |
| 68 // Unique identifier | 75 // Unique identifier |
| 69 string id; | 76 string id; |
| 70 // Toast text. | 77 // Toast text. |
| 71 string text; | 78 string text; |
| 72 // Toast duration in milliseconds. | 79 // Toast duration in milliseconds. |
| 73 int32 duration; | 80 int32 duration; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 94 | 101 |
| 95 // TODO(lhchavez): Migrate all request/response messages to Mojo. | 102 // TODO(lhchavez): Migrate all request/response messages to Mojo. |
| 96 interface NotificationsInstance { | 103 interface NotificationsInstance { |
| 97 // Establishes full-duplex communication with the host. | 104 // Establishes full-duplex communication with the host. |
| 98 Init(NotificationsHost host_ptr); | 105 Init(NotificationsHost host_ptr); |
| 99 | 106 |
| 100 // Sends an event from Chrome notification UI to Android. | 107 // Sends an event from Chrome notification UI to Android. |
| 101 // |event| is a type of occured event. | 108 // |event| is a type of occured event. |
| 102 SendNotificationEventToAndroid(string key, ArcNotificationEvent event); | 109 SendNotificationEventToAndroid(string key, ArcNotificationEvent event); |
| 103 }; | 110 }; |
| OLD | NEW |