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 @@ ...@@ -5,7 +5,9 @@
module crosapi.mojom; module crosapi.mojom;
// Each pixel is represented by 4 bytes [RGBA]. // 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. // TODO(https://crbug.com/1094460): Use a more performant transport mechanism.
[Stable]
struct Bitmap { struct Bitmap {
uint32 width; uint32 width;
uint32 height; uint32 height;
......
...@@ -10,34 +10,36 @@ import "mojo/public/mojom/base/string16.mojom"; ...@@ -10,34 +10,36 @@ import "mojo/public/mojom/base/string16.mojom";
// Handles notifications created via the Notifications web platform API and the // Handles notifications created via the Notifications web platform API and the
// chrome.notifications() extension API. Shows the notifications in the // chrome.notifications() extension API. Shows the notifications in the
// message center. Implemented in ash-chrome. // message center. Implemented in ash-chrome.
[Stable]
interface MessageCenter { interface MessageCenter {
// Displays a notification. If the notification's ID is the same as an // Displays a notification. If the notification's ID is the same as an
// existing notification, that notification is replaced. The delegate will be // existing notification, that notification is replaced. The delegate will be
// called with user actions. // called with user actions.
DisplayNotification(Notification notification, DisplayNotification@0(Notification notification,
pending_remote<NotificationDelegate> delegate); pending_remote<NotificationDelegate> delegate);
// Closes a notification by the ID provided in |notification| above. // 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 // Handles responses to user actions on notifications. Multiple actions may
// occur on a single notification. For example, clicking a notification button // occur on a single notification. For example, clicking a notification button
// may not close the notification. Implemented in lacros-chrome. // may not close the notification. Implemented in lacros-chrome.
[Stable]
interface NotificationDelegate { interface NotificationDelegate {
// Called when a notification previously displayed by the client is closed. // 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. // 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 // Called when a notification that has buttons (e.g., "Learn more") receives a
// click on one of the buttons. // 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. // Called when a notification's settings button has been pressed.
OnNotificationSettingsButtonClicked(); OnNotificationSettingsButtonClicked@3();
// Called when a notification has been disabled (via inline settings). // Called when a notification has been disabled (via inline settings).
OnNotificationDisabled(); OnNotificationDisabled@4();
}; };
...@@ -12,7 +12,7 @@ import "url/mojom/url.mojom"; ...@@ -12,7 +12,7 @@ import "url/mojom/url.mojom";
// Type of notification to show. See the chrome.notifications extension API: // Type of notification to show. See the chrome.notifications extension API:
// https://developer.chrome.com/extensions/notifications#type-TemplateType // https://developer.chrome.com/extensions/notifications#type-TemplateType
[Extensible] [Stable, Extensible]
enum NotificationType { enum NotificationType {
// Icon, title and message. // Icon, title and message.
kSimple = 0, kSimple = 0,
...@@ -30,7 +30,7 @@ enum NotificationType { ...@@ -30,7 +30,7 @@ enum NotificationType {
// How to display notifications when a fullscreen window is open. For example, // How to display notifications when a fullscreen window is open. For example,
// a child account time limit notification should appear over a fullscreen // a child account time limit notification should appear over a fullscreen
// video. // video.
[Extensible] [Stable, Extensible]
enum FullscreenVisibility { enum FullscreenVisibility {
// Do not show over fullscreen windows. // Do not show over fullscreen windows.
kNone = 0, kNone = 0,
...@@ -40,6 +40,7 @@ enum FullscreenVisibility { ...@@ -40,6 +40,7 @@ enum FullscreenVisibility {
}; };
// List items for NotificationType::kList. // List items for NotificationType::kList.
[Stable]
struct NotificationItem { struct NotificationItem {
mojo_base.mojom.String16 title; mojo_base.mojom.String16 title;
mojo_base.mojom.String16 message; mojo_base.mojom.String16 message;
...@@ -47,6 +48,7 @@ struct NotificationItem { ...@@ -47,6 +48,7 @@ struct NotificationItem {
// Data for each button. Implemented as a struct for extensibility (e.g. so we // Data for each button. Implemented as a struct for extensibility (e.g. so we
// could add icon buttons). // could add icon buttons).
[Stable]
struct ButtonInfo { struct ButtonInfo {
mojo_base.mojom.String16 title; mojo_base.mojom.String16 title;
}; };
...@@ -56,6 +58,7 @@ struct ButtonInfo { ...@@ -56,6 +58,7 @@ struct ButtonInfo {
// API. See documentation at: // API. See documentation at:
// https://developer.mozilla.org/en-US/docs/Web/API/notification // https://developer.mozilla.org/en-US/docs/Web/API/notification
// https://developer.chrome.com/extensions/notifications#type-NotificationOptions // https://developer.chrome.com/extensions/notifications#type-NotificationOptions
[Stable]
struct Notification { struct Notification {
// Type of notification to show. // Type of notification to show.
NotificationType type; 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