Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: third_party/WebKit/public/platform/modules/notifications/notification.mojom

Issue 1814813002: Define a Mojo Notification structure in the Blink API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/public/blink.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+};
« no previous file with comments | « third_party/WebKit/public/blink.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698