OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // Use the <code>chrome.notifications</code> API to create rich notifications | 5 // Use the <code>chrome.notifications</code> API to create rich notifications |
6 // using templates and show these notifications to users in the system tray. | 6 // using templates and show these notifications to users in the system tray. |
7 namespace notifications { | 7 namespace notifications { |
8 [noinline_doc] enum TemplateType { | 8 [noinline_doc] enum TemplateType { |
9 // icon, title, message, expandedMessage, up to two buttons | 9 // icon, title, message, expandedMessage, up to two buttons |
10 basic, | 10 basic, |
11 | 11 |
12 // icon, title, message, expandedMessage, image, up to two buttons | 12 // icon, title, message, expandedMessage, image, up to two buttons |
13 image, | 13 image, |
14 | 14 |
15 // icon, title, message, items, up to two buttons | 15 // icon, title, message, items, up to two buttons |
16 list | 16 list, |
| 17 |
| 18 // icon, title, message, progress, up to two buttons |
| 19 progress |
17 }; | 20 }; |
18 | 21 |
19 dictionary NotificationItem { | 22 dictionary NotificationItem { |
20 // Title of one item of a list notification. | 23 // Title of one item of a list notification. |
21 DOMString title; | 24 DOMString title; |
22 | 25 |
23 // Additional details about this item. | 26 // Additional details about this item. |
24 DOMString message; | 27 DOMString message; |
25 }; | 28 }; |
26 | 29 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 66 |
64 // Secondary notification content. | 67 // Secondary notification content. |
65 [nodoc] DOMString? expandedMessage; | 68 [nodoc] DOMString? expandedMessage; |
66 | 69 |
67 // Image thumbnail for image-type notifications. | 70 // Image thumbnail for image-type notifications. |
68 DOMString? imageUrl; | 71 DOMString? imageUrl; |
69 [nodoc] NotificationBitmap? imageBitmap; | 72 [nodoc] NotificationBitmap? imageBitmap; |
70 | 73 |
71 // Items for multi-item notifications. | 74 // Items for multi-item notifications. |
72 NotificationItem[]? items; | 75 NotificationItem[]? items; |
| 76 |
| 77 // Current progress ranges from 0 to 100. |
| 78 long? progress; |
73 }; | 79 }; |
74 | 80 |
75 callback CreateCallback = void (DOMString notificationId); | 81 callback CreateCallback = void (DOMString notificationId); |
76 | 82 |
77 callback UpdateCallback = void (boolean wasUpdated); | 83 callback UpdateCallback = void (boolean wasUpdated); |
78 | 84 |
79 callback ClearCallback = void (boolean wasCleared); | 85 callback ClearCallback = void (boolean wasCleared); |
80 | 86 |
81 callback GetAllCallback = void (object notifications); | 87 callback GetAllCallback = void (object notifications); |
82 | 88 |
(...skipping 30 matching lines...) Expand all Loading... |
113 static void onClosed(DOMString notificationId, boolean byUser); | 119 static void onClosed(DOMString notificationId, boolean byUser); |
114 | 120 |
115 // The user clicked in a non-button area of the notification. | 121 // The user clicked in a non-button area of the notification. |
116 static void onClicked(DOMString notificationId); | 122 static void onClicked(DOMString notificationId); |
117 | 123 |
118 // The user pressed a button in the notification. | 124 // The user pressed a button in the notification. |
119 static void onButtonClicked(DOMString notificationId, long buttonIndex); | 125 static void onButtonClicked(DOMString notificationId, long buttonIndex); |
120 }; | 126 }; |
121 | 127 |
122 }; | 128 }; |
OLD | NEW |