| Index: third_party/WebKit/public/platform/modules/notifications/notification.mojom
|
| diff --git a/third_party/WebKit/public/platform/modules/notifications/notification.mojom b/third_party/WebKit/public/platform/modules/notifications/notification.mojom
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f82e322eb62c0d9c5f4f0b4b8c53853168199a97
|
| --- /dev/null
|
| +++ b/third_party/WebKit/public/platform/modules/notifications/notification.mojom
|
| @@ -0,0 +1,77 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +module blink.mojom;
|
| +
|
| +// Structure representing an action button associated with a Notification.
|
| +struct NotificationAction {
|
| + // Action name that the author can use to distinguish them.
|
| + string action;
|
| +
|
| + // Title of the action button.
|
| + string title;
|
| +
|
| + // URL of the icon for the button. May be empty if no url was specified.
|
| + string icon;
|
| +};
|
| +
|
| +// Directionality options that can be indicated for notifications.
|
| +enum NotificationDirection {
|
| + LEFT_TO_RIGHT,
|
| + RIGHT_TO_LEFT,
|
| + AUTO
|
| +};
|
| +
|
| +// Structure representing the information associated with a Web Notification.
|
| +// Resources should be passed separately using the NotificationResources object.
|
| +struct Notification {
|
| + // The maximum size of the serialized developer-provided data to be stored in
|
| + // the |data| property of this structure.
|
| + const int32 kMaximumDeveloperDataBytes = 1048576; // 1MB
|
| +
|
| + // Title to be displayed with the Web Notification.
|
| + string title;
|
| +
|
| + // Hint to determine the directionality of the displayed notification.
|
| + NotificationDirection direction;
|
| +
|
| + // BCP 47 language tag describing the notification's contents. Optional.
|
| + string? lang;
|
| +
|
| + // Contents of the notification.
|
| + string body;
|
| +
|
| + // Tag of the notification. Notifications sharing both their origin and their
|
| + // tag will replace the first displayed notification.
|
| + string tag;
|
| +
|
| + // URL of the icon which is to be displayed with the notification.
|
| + string icon;
|
| +
|
| + // Vibration pattern for the notification, following the syntax of the
|
| + // Vibration API. https://w3c.github.io/vibration/
|
| + array<int32> vibration_pattern;
|
| +
|
| + // The time at which the event the notification represents took place.
|
| + double timestamp;
|
| +
|
| + // Whether default notification indicators (sound, vibration, light) should
|
| + // be played again if the notification is replacing an older notification.
|
| + bool renotify = false;
|
| +
|
| + // Whether default notification indicators (sound, vibration, light) should
|
| + // be suppressed.
|
| + bool silent = false;
|
| +
|
| + // Whether the notification should remain onscreen indefinitely, rather than
|
| + // being auto-minimized to the notification center (if allowed by platform).
|
| + bool require_interaction = false;
|
| +
|
| + // Developer-provided data associated with the notification, in the form of
|
| + // a serialized string. Must not exceed |kMaximumDeveloperDataBytes| bytes.
|
| + array<int8> data;
|
| +
|
| + // Actions that should be shown as buttons on the notification.
|
| + array<NotificationAction> actions;
|
| +};
|
|
|