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, |
(...skipping 23 matching lines...) Expand all Loading... |
34 }; | 34 }; |
35 | 35 |
36 dictionary NotificationButton { | 36 dictionary NotificationButton { |
37 DOMString title; | 37 DOMString title; |
38 DOMString? iconUrl; | 38 DOMString? iconUrl; |
39 [nodoc] NotificationBitmap? iconBitmap; | 39 [nodoc] NotificationBitmap? iconBitmap; |
40 }; | 40 }; |
41 | 41 |
42 dictionary NotificationOptions { | 42 dictionary NotificationOptions { |
43 // Which type of notification to display. | 43 // Which type of notification to display. |
44 TemplateType type; | 44 TemplateType? type; |
45 | 45 |
46 // Sender's avatar, app icon, or a thumbnail for image notifications. | 46 // Sender's avatar, app icon, or a thumbnail for image notifications. |
47 DOMString iconUrl; | 47 DOMString? iconUrl; |
48 [nodoc] NotificationBitmap? iconBitmap; | 48 [nodoc] NotificationBitmap? iconBitmap; |
49 | 49 |
50 // Title of the notification (e.g. sender name for email). | 50 // Title of the notification (e.g. sender name for email). |
51 DOMString title; | 51 DOMString? title; |
52 | 52 |
53 // Main notification content. | 53 // Main notification content. |
54 DOMString message; | 54 DOMString? message; |
55 | 55 |
56 // Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero | 56 // Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero |
57 // is default. | 57 // is default. |
58 long? priority; | 58 long? priority; |
59 | 59 |
60 // A timestamp associated with the notification, in milliseconds past the | 60 // A timestamp associated with the notification, in milliseconds past the |
61 // epoch (e.g. <code>Date.now() + n</code>). | 61 // epoch (e.g. <code>Date.now() + n</code>). |
62 double? eventTime; | 62 double? eventTime; |
63 | 63 |
64 // Text and icons of notification action buttons. | 64 // Text and icons of notification action buttons. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 static void onClosed(DOMString notificationId, boolean byUser); | 119 static void onClosed(DOMString notificationId, boolean byUser); |
120 | 120 |
121 // The user clicked in a non-button area of the notification. | 121 // The user clicked in a non-button area of the notification. |
122 static void onClicked(DOMString notificationId); | 122 static void onClicked(DOMString notificationId); |
123 | 123 |
124 // The user pressed a button in the notification. | 124 // The user pressed a button in the notification. |
125 static void onButtonClicked(DOMString notificationId, long buttonIndex); | 125 static void onButtonClicked(DOMString notificationId, long buttonIndex); |
126 }; | 126 }; |
127 | 127 |
128 }; | 128 }; |
OLD | NEW |