| OLD | NEW |
| 1 <p class="note"> | 1 <p class="note"> |
| 2 <b>Note: </b> | 2 <b>Note: </b> |
| 3 This API is currently available on ChromeOS, Windows, and Mac. | 3 This API is currently available on ChromeOS, Windows, and Mac. |
| 4 </p> | 4 </p> |
| 5 | 5 |
| 6 <h2 id="usage">Usage</h2> | 6 <h2 id="usage">Usage</h2> |
| 7 | 7 |
| 8 <p> | 8 <p> |
| 9 To use this API, | 9 To use this API, |
| 10 call the $(ref:notifications.create) method, | 10 call the $(ref:notifications.create) method, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 </p> | 24 </p> |
| 25 | 25 |
| 26 <p> | 26 <p> |
| 27 All template types | 27 All template types |
| 28 (<code>basic</code>, <code>image</code>, and <code>list</code>) | 28 (<code>basic</code>, <code>image</code>, and <code>list</code>) |
| 29 must include a notification <code>title</code> and <code>message</code>, | 29 must include a notification <code>title</code> and <code>message</code>, |
| 30 as well as an <code>iconUrl</code>, which is a link to a small icon that | 30 as well as an <code>iconUrl</code>, which is a link to a small icon that |
| 31 is displayed to the left of the notification message. The <code>image</code> | 31 is displayed to the left of the notification message. The <code>image</code> |
| 32 template type also includes an <code>imageUrl</code>, which is a link to | 32 template type also includes an <code>imageUrl</code>, which is a link to |
| 33 an image that is previewed within the notification. | 33 an image that is previewed within the notification. |
| 34 Due to a strict <a href="contentSecurityPolicy.html">Content Security Policy</a> | 34 Due to a strict <a href="contentSecurityPolicy">Content Security Policy</a> |
| 35 in Chrome Apps, these URLs must point to a local resource or use a | 35 in Chrome Apps, these URLs must point to a local resource or use a |
| 36 <a href="app_external.html">data URL</a>. | 36 <a href="app_external">data URL</a>. |
| 37 </p> | 37 </p> |
| 38 | 38 |
| 39 <p> | 39 <p> |
| 40 Here's an example of a <code>basic</code> template: | 40 Here's an example of a <code>basic</code> template: |
| 41 </p> | 41 </p> |
| 42 | 42 |
| 43 <pre> | 43 <pre> |
| 44 var opt = { | 44 var opt = { |
| 45 type: "basic", | 45 type: "basic", |
| 46 title: "Primary Title", | 46 title: "Primary Title", |
| (...skipping 28 matching lines...) Expand all Loading... |
| 75 | 75 |
| 76 <p> | 76 <p> |
| 77 All notifications can include event listeners and event handlers | 77 All notifications can include event listeners and event handlers |
| 78 that respond to user actions. | 78 that respond to user actions. |
| 79 For example, | 79 For example, |
| 80 you can write an event handler to respond to an | 80 you can write an event handler to respond to an |
| 81 $(ref:notifications.onButtonClicked) event. | 81 $(ref:notifications.onButtonClicked) event. |
| 82 </p> | 82 </p> |
| 83 | 83 |
| 84 <p>Consider including event listeners and handlers within the | 84 <p>Consider including event listeners and handlers within the |
| 85 <a href="app_lifecycle.html#create_event_page">event page</a>, | 85 <a href="app_lifecycle#create_event_page">event page</a>, |
| 86 so that notifications can pop-up even when the app or extension isn't running. | 86 so that notifications can pop-up even when the app or extension isn't running. |
| 87 </p> | 87 </p> |
| OLD | NEW |