OLD | NEW |
1 <table class="intro"> | 1 <table class="intro"> |
2 <tr> | 2 <tr> |
3 <th scope="col"></th> | 3 <th scope="col"></th> |
4 <th scope="col"></th> | 4 <th scope="col"></th> |
5 </tr> | 5 </tr> |
6 <tr> | 6 <tr> |
7 <td><strong>Description:</strong></td> | 7 <td><strong>Description:</strong></td> |
8 <td>Use the <code>chrome.notifications</code> module | 8 <td>Use the <code>chrome.notifications</code> module |
9 to create rich notifications using templates and | 9 to create rich notifications using templates and |
10 show these notifications to users in the system tray | 10 show these notifications to users in the system tray |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 <p class="warning"> | 27 <p class="warning"> |
28 <b>Warning: </b> | 28 <b>Warning: </b> |
29 Currently this API only works on ChromeOS and Windows. | 29 Currently this API only works on ChromeOS and Windows. |
30 </p> | 30 </p> |
31 | 31 |
32 <h2 id="usage">Usage</h2> | 32 <h2 id="usage">Usage</h2> |
33 | 33 |
34 <p> | 34 <p> |
35 To use this API, | 35 To use this API, |
36 call the $ref:experimental.notification.create method, | 36 call the $ref:notifications.create method, |
37 passing in the notification details | 37 passing in the notification details |
38 via the <code>options</code> parameter: | 38 via the <code>options</code> parameter: |
39 </p> | 39 </p> |
40 | 40 |
41 <pre> | 41 <pre> |
42 chrome.experimental.notification | 42 chrome.experimental.notification |
43 .create(id, options, creationCallback); | 43 .create(id, options, creationCallback); |
44 </pre> | 44 </pre> |
45 | 45 |
46 <p> | 46 <p> |
47 The $ref:experimental.notification.NotificationOptions must include the | 47 The $ref:notifications.NotificationOptions must include the |
48 $ref:experimental.notification.TemplateType | 48 $ref:notifications.TemplateType |
49 which defines available notification details | 49 which defines available notification details |
50 and how those details are displayed. | 50 and how those details are displayed. |
51 All four available template types | 51 All four available template types |
52 (<code>simple</code>, <code>basic</code>, <code>image</code>, <code>list</code>) | 52 (<code>simple</code>, <code>basic</code>, <code>image</code>, <code>list</code>) |
53 include the notification <code>title</code> and <code>message</code>. | 53 include the notification <code>title</code> and <code>message</code>. |
54 </p> | 54 </p> |
55 | 55 |
56 <p> | 56 <p> |
57 They can also include urls to icons or images. | 57 They can also include urls to icons or images. |
58 The <code>simple</code>, <code>basic</code>, and <code>list</code> | 58 The <code>simple</code>, <code>basic</code>, and <code>list</code> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 </p> | 105 </p> |
106 | 106 |
107 <h2 id="events">Listening for and responding to events</h2> | 107 <h2 id="events">Listening for and responding to events</h2> |
108 | 108 |
109 <p> | 109 <p> |
110 With the exception of the <code>simple</code> template, | 110 With the exception of the <code>simple</code> template, |
111 all notifications can include event listeners and event handlers | 111 all notifications can include event listeners and event handlers |
112 which respond to user actions. | 112 which respond to user actions. |
113 For example, | 113 For example, |
114 you can write an event handler to respond to an | 114 you can write an event handler to respond to an |
115 $ref:experimental.notification.onButtonClicked event. | 115 $ref:notifications.onButtonClicked event. |
116 </p> | 116 </p> |
117 | 117 |
118 <p>Consider including event listeners and handlers within the | 118 <p>Consider including event listeners and handlers within the |
119 <a href="app_lifecycle.html#create_event_page">event page</a>, | 119 <a href="app_lifecycle.html#create_event_page">event page</a>, |
120 so that notifications can pop-up even when the app or extension isn't running. | 120 so that notifications can pop-up even when the app or extension isn't running. |
121 </p> | 121 </p> |
OLD | NEW |