Commit 18ddde25 authored by James Cook's avatar James Cook Committed by Commit Bot

lacros: Mark the message center mojo API as [Stable]

Mark crosapi.mojom.Bitmap as stable (it's simple and controlled by the
lacros project).

Mark crosapi.mojom.Notification as stable (its only interesting
dependency, ImageSkia, was recently stabilized).

Bug: 1113889
Test: presubmits
Change-Id: I0dbf3663d3bd4af72184d360be1f6f4269a5eab4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388907Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Auto-Submit: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803998}
parent 4b42d071
......@@ -5,7 +5,9 @@
module crosapi.mojom;
// Each pixel is represented by 4 bytes [RGBA].
// NOTE: For UI images prefer gfx.mojom.ImageSkia, which supports high-DPI.
// TODO(https://crbug.com/1094460): Use a more performant transport mechanism.
[Stable]
struct Bitmap {
uint32 width;
uint32 height;
......
......@@ -10,34 +10,36 @@ import "mojo/public/mojom/base/string16.mojom";
// Handles notifications created via the Notifications web platform API and the
// chrome.notifications() extension API. Shows the notifications in the
// message center. Implemented in ash-chrome.
[Stable]
interface MessageCenter {
// Displays a notification. If the notification's ID is the same as an
// existing notification, that notification is replaced. The delegate will be
// called with user actions.
DisplayNotification(Notification notification,
DisplayNotification@0(Notification notification,
pending_remote<NotificationDelegate> delegate);
// Closes a notification by the ID provided in |notification| above.
CloseNotification(string id);
CloseNotification@1(string id);
};
// Handles responses to user actions on notifications. Multiple actions may
// occur on a single notification. For example, clicking a notification button
// may not close the notification. Implemented in lacros-chrome.
[Stable]
interface NotificationDelegate {
// Called when a notification previously displayed by the client is closed.
OnNotificationClosed(bool by_user);
OnNotificationClosed@0(bool by_user);
// Called when the body of a notification is clicked.
OnNotificationClicked();
OnNotificationClicked@1();
// Called when a notification that has buttons (e.g., "Learn more") receives a
// click on one of the buttons.
OnNotificationButtonClicked(uint32 button_index);
OnNotificationButtonClicked@2(uint32 button_index);
// Called when a notification's settings button has been pressed.
OnNotificationSettingsButtonClicked();
OnNotificationSettingsButtonClicked@3();
// Called when a notification has been disabled (via inline settings).
OnNotificationDisabled();
OnNotificationDisabled@4();
};
......@@ -12,7 +12,7 @@ import "url/mojom/url.mojom";
// Type of notification to show. See the chrome.notifications extension API:
// https://developer.chrome.com/extensions/notifications#type-TemplateType
[Extensible]
[Stable, Extensible]
enum NotificationType {
// Icon, title and message.
kSimple = 0,
......@@ -30,7 +30,7 @@ enum NotificationType {
// How to display notifications when a fullscreen window is open. For example,
// a child account time limit notification should appear over a fullscreen
// video.
[Extensible]
[Stable, Extensible]
enum FullscreenVisibility {
// Do not show over fullscreen windows.
kNone = 0,
......@@ -40,6 +40,7 @@ enum FullscreenVisibility {
};
// List items for NotificationType::kList.
[Stable]
struct NotificationItem {
mojo_base.mojom.String16 title;
mojo_base.mojom.String16 message;
......@@ -47,6 +48,7 @@ struct NotificationItem {
// Data for each button. Implemented as a struct for extensibility (e.g. so we
// could add icon buttons).
[Stable]
struct ButtonInfo {
mojo_base.mojom.String16 title;
};
......@@ -56,6 +58,7 @@ struct ButtonInfo {
// API. See documentation at:
// https://developer.mozilla.org/en-US/docs/Web/API/notification
// https://developer.chrome.com/extensions/notifications#type-NotificationOptions
[Stable]
struct Notification {
// Type of notification to show.
NotificationType type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment