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

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

Issue 1898193003: Add type converters from Mojo notifications to the content types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification-permission-mojom
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 module blink.mojom; 5 module blink.mojom;
6 6
7 // The different types of actions that can be added to a Notification.
8 enum NotificationActionType {
9 BUTTON,
10 TEXT
11 };
12
7 // Structure representing an action button associated with a Notification. 13 // Structure representing an action button associated with a Notification.
8 struct NotificationAction { 14 struct NotificationAction {
15 // Type of action this structure represents.
16 NotificationActionType type;
17
9 // Action name that the author can use to distinguish them. 18 // Action name that the author can use to distinguish them.
10 string action; 19 string action;
11 20
12 // Title of the action button. 21 // Title of the action button.
13 string title; 22 string title;
14 23
15 // URL of the icon for the button. May be empty if no url was specified. 24 // URL of the icon for the button. May be empty if no url was specified.
16 string icon; 25 string icon;
26
27 // Placeholder to display for text-based actions in absense of user input.
Michael van Ouwerkerk 2016/04/20 10:20:09 nit: s/absense/absence/
Peter Beverloo 2016/04/20 12:45:54 Done.
28 string? placeholder;
17 }; 29 };
18 30
19 // Directionality options that can be indicated for notifications. 31 // Directionality options that can be indicated for notifications.
20 enum NotificationDirection { 32 enum NotificationDirection {
21 LEFT_TO_RIGHT, 33 LEFT_TO_RIGHT,
22 RIGHT_TO_LEFT, 34 RIGHT_TO_LEFT,
23 AUTO 35 AUTO
24 }; 36 };
25 37
26 // Structure representing the information associated with a Web Notification. 38 // Structure representing the information associated with a Web Notification.
(...skipping 15 matching lines...) Expand all
42 // Contents of the notification. 54 // Contents of the notification.
43 string body; 55 string body;
44 56
45 // Tag of the notification. Notifications sharing both their origin and their 57 // Tag of the notification. Notifications sharing both their origin and their
46 // tag will replace the first displayed notification. 58 // tag will replace the first displayed notification.
47 string tag; 59 string tag;
48 60
49 // URL of the icon which is to be displayed with the notification. 61 // URL of the icon which is to be displayed with the notification.
50 string icon; 62 string icon;
51 63
64 // URL of the badge representing the website displaying the notification.
65 string badge;
66
52 // Vibration pattern for the notification, following the syntax of the 67 // Vibration pattern for the notification, following the syntax of the
53 // Vibration API. https://w3c.github.io/vibration/ 68 // Vibration API. https://w3c.github.io/vibration/
54 array<int32> vibration_pattern; 69 array<uint32> vibration_pattern;
55 70
56 // The time at which the event the notification represents took place. 71 // The time at which the event the notification represents took place.
57 double timestamp; 72 double timestamp;
58 73
59 // Whether default notification indicators (sound, vibration, light) should 74 // Whether default notification indicators (sound, vibration, light) should
60 // be played again if the notification is replacing an older notification. 75 // be played again if the notification is replacing an older notification.
61 bool renotify = false; 76 bool renotify = false;
62 77
63 // Whether default notification indicators (sound, vibration, light) should 78 // Whether default notification indicators (sound, vibration, light) should
64 // be suppressed. 79 // be suppressed.
65 bool silent = false; 80 bool silent = false;
66 81
67 // Whether the notification should remain onscreen indefinitely, rather than 82 // Whether the notification should remain onscreen indefinitely, rather than
68 // being auto-minimized to the notification center (if allowed by platform). 83 // being auto-minimized to the notification center (if allowed by platform).
69 bool require_interaction = false; 84 bool require_interaction = false;
70 85
71 // Developer-provided data associated with the notification, in the form of 86 // Developer-provided data associated with the notification, in the form of
72 // a serialized string. Must not exceed |kMaximumDeveloperDataBytes| bytes. 87 // a serialized string. Must not exceed |kMaximumDeveloperDataBytes| bytes.
73 array<int8> data; 88 array<int8> data;
74 89
75 // Actions that should be shown as buttons on the notification. 90 // Actions that should be shown as buttons on the notification.
76 array<NotificationAction> actions; 91 array<NotificationAction> actions;
77 }; 92 };
OLDNEW
« content/browser/notifications/type_converters_unittest.cc ('K') | « content/content_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698