| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module blink.mojom; |
| 6 |
| 7 // Structure representing an action button associated with a Notification. |
| 8 struct NotificationAction { |
| 9 // Action name that the author can use to distinguish them. |
| 10 string action; |
| 11 |
| 12 // Title of the action button. |
| 13 string title; |
| 14 |
| 15 // URL of the icon for the button. May be empty if no url was specified. |
| 16 string icon; |
| 17 }; |
| 18 |
| 19 // Directionality options that can be indicated for notifications. |
| 20 enum NotificationDirection { |
| 21 LEFT_TO_RIGHT, |
| 22 RIGHT_TO_LEFT, |
| 23 AUTO |
| 24 }; |
| 25 |
| 26 // Structure representing the information associated with a Web Notification. |
| 27 // Resources should be passed separately using the NotificationResources object. |
| 28 struct Notification { |
| 29 // The maximum size of the serialized developer-provided data to be stored in |
| 30 // the |data| property of this structure. |
| 31 const int32 kMaximumDeveloperDataBytes = 1048576; // 1MB |
| 32 |
| 33 // Title to be displayed with the Web Notification. |
| 34 string title; |
| 35 |
| 36 // Hint to determine the directionality of the displayed notification. |
| 37 NotificationDirection direction; |
| 38 |
| 39 // BCP 47 language tag describing the notification's contents. Optional. |
| 40 string? lang; |
| 41 |
| 42 // Contents of the notification. |
| 43 string body; |
| 44 |
| 45 // Tag of the notification. Notifications sharing both their origin and their |
| 46 // tag will replace the first displayed notification. |
| 47 string tag; |
| 48 |
| 49 // URL of the icon which is to be displayed with the notification. |
| 50 string icon; |
| 51 |
| 52 // Vibration pattern for the notification, following the syntax of the |
| 53 // Vibration API. https://w3c.github.io/vibration/ |
| 54 array<int32> vibration_pattern; |
| 55 |
| 56 // The time at which the event the notification represents took place. |
| 57 double timestamp; |
| 58 |
| 59 // Whether default notification indicators (sound, vibration, light) should |
| 60 // be played again if the notification is replacing an older notification. |
| 61 bool renotify = false; |
| 62 |
| 63 // Whether default notification indicators (sound, vibration, light) should |
| 64 // be suppressed. |
| 65 bool silent = false; |
| 66 |
| 67 // Whether the notification should remain onscreen indefinitely, rather than |
| 68 // being auto-minimized to the notification center (if allowed by platform). |
| 69 bool require_interaction = false; |
| 70 |
| 71 // Developer-provided data associated with the notification, in the form of |
| 72 // a serialized string. Must not exceed |kMaximumDeveloperDataBytes| bytes. |
| 73 array<int8> data; |
| 74 |
| 75 // Actions that should be shown as buttons on the notification. |
| 76 array<NotificationAction> actions; |
| 77 }; |
| OLD | NEW |