Chromium Code Reviews| 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 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module notifications; | 6 module notifications; |
| 7 | 7 |
| 8 struct NotificationData { | 8 struct NotificationData { |
| 9 // Title to be displayed along with the notification, if supported. | 9 // Title to be displayed along with the notification, if supported. |
| 10 string? title; | 10 string? title; |
| 11 | 11 |
| 12 // Text to be displayed along with the notification, if supported. | 12 // Text to be displayed along with the notification, if supported. |
| 13 string? text; | 13 string? text; |
| 14 | |
| 15 // Indicates if notification sound must be played when notification is thrown. | |
|
Andrew T Wilson (Slow)
2015/11/26 09:36:27
nit: thrown->shown
| |
| 16 bool play_sound; | |
| 17 | |
| 18 // Indicates if the device should vibrate, if it supports. | |
|
Andrew T Wilson (Slow)
2015/11/26 09:36:27
nit: supports -> supports vibration.
| |
| 19 bool vibrate; | |
| 20 | |
| 21 // Indicates if notification lights must be set so that the lights can blink | |
| 22 // till the notification is attended.Note, this would depend on the device | |
|
Andrew T Wilson (Slow)
2015/11/26 09:36:27
Space before "Note"
| |
| 23 // support for notification lights. | |
| 24 bool set_lights; | |
| 14 }; | 25 }; |
| 15 | 26 |
| 16 // Interaction with a posted notification will be communicated through the | 27 // Interaction with a posted notification will be communicated through the |
| 17 // NotificationClient. Once a NotificationClient callback has been called the | 28 // NotificationClient. Once a NotificationClient callback has been called the |
| 18 // notification can be considered removed and subsequent Update and Cancel calls | 29 // notification can be considered removed and subsequent Update and Cancel calls |
| 19 // to the Notification populated during Post will be ignored. | 30 // to the Notification populated during Post will be ignored. |
| 20 interface NotificationClient { | 31 interface NotificationClient { |
| 21 // Called when the notification is selected. | 32 // Called when the notification is selected. |
| 22 OnSelected(); | 33 OnSelected(); |
| 23 | 34 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 36 | 47 |
| 37 [ServiceName="notifications::NotificationService"] | 48 [ServiceName="notifications::NotificationService"] |
| 38 interface NotificationService { | 49 interface NotificationService { |
| 39 // Posts a new notification with the information specified in | 50 // Posts a new notification with the information specified in |
| 40 // |notification_data| and with any interactions with the notification being | 51 // |notification_data| and with any interactions with the notification being |
| 41 // communicated to |client|. |notification| can be used to modify or cancel | 52 // communicated to |client|. |notification| can be used to modify or cancel |
| 42 // the notification. | 53 // the notification. |
| 43 Post(NotificationData notification_data, NotificationClient? client, | 54 Post(NotificationData notification_data, NotificationClient? client, |
| 44 Notification&? notification); | 55 Notification&? notification); |
| 45 }; | 56 }; |
| OLD | NEW |