Commit 7b359c7c authored by James Cook's avatar James Cook Committed by Commit Bot

lacros: Add explicit ordinals to several crosapi mojom structs

Crosapi mojoms have to be backwards compatible. Most interfaces and
structs use explicit ordinal values (@0, @1, ...) to emphasize this,
but I missed a couple of them. Add annotations to the missing ones,
so we're consistent throughout //chromeos/crosapi/mojom.

Bug: none
Change-Id: I9c7e7729cbdab903154d8d9c3d10b2e44fbb0b50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2442645Reviewed-by: default avatarDarin Fisher <darin@chromium.org>
Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Auto-Submit: James Cook <jamescook@chromium.org>
Commit-Queue: Greg Kerr <kerrnel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813392}
parent f604b7d4
......@@ -9,7 +9,7 @@ module crosapi.mojom;
// TODO(https://crbug.com/1094460): Use a more performant transport mechanism.
[Stable]
struct Bitmap {
uint32 width;
uint32 height;
array<uint8> pixels;
uint32 width@0;
uint32 height@1;
array<uint8> pixels@2;
};
......@@ -42,15 +42,15 @@ enum FullscreenVisibility {
// List items for NotificationType::kList.
[Stable]
struct NotificationItem {
mojo_base.mojom.String16 title;
mojo_base.mojom.String16 message;
mojo_base.mojom.String16 title@0;
mojo_base.mojom.String16 message@1;
};
// 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;
mojo_base.mojom.String16 title@0;
};
// A notification to show in the system message center. Fields exist to support
......@@ -61,87 +61,87 @@ struct ButtonInfo {
[Stable]
struct Notification {
// Type of notification to show.
NotificationType type;
NotificationType type@0;
// The client decides the format of the ID.
string id;
string id@1;
// The title, usually just a few words.
mojo_base.mojom.String16 title;
mojo_base.mojom.String16 title@2;
// The message body. If long, will wrap inside the notification.
mojo_base.mojom.String16 message;
mojo_base.mojom.String16 message@3;
// Human-readable description of the source of the notification. For example,
// "Google Calendar".
mojo_base.mojom.String16 display_source;
mojo_base.mojom.String16 display_source@4;
// For web notifications, the URL of the website responsible for showing the
// notification. Otherwise empty.
url.mojom.Url? origin_url;
url.mojom.Url? origin_url@5;
// DEPRECATED, replaced with |icon| below.
Bitmap? deprecated_icon;
Bitmap? deprecated_icon@6;
// Priority from -2 to 2. Zero is the default. Other values are clamped.
int32 priority;
int32 priority@7;
// User must explicitly dismiss.
bool require_interaction;
bool require_interaction@8;
// Time at which the notification is applicable (past, present or future).
// See web platform API "timestamp" and chrome.notifications "eventTime".
mojo_base.mojom.Time timestamp;
mojo_base.mojom.Time timestamp@9;
// DEPRECATED, replaced with |image| below.
Bitmap? deprecated_image;
Bitmap? deprecated_image@10;
// DEPRECATED, replaced with |badge| below.
Bitmap? deprecated_badge;
Bitmap? deprecated_badge@11;
// Item list for type kList. Not displayed for other types.
array<NotificationItem> items;
array<NotificationItem> items@12;
// Progress from 0 to 100 for type kProgress. Negative values result in an
// animating "indefinite progress" indicator. Values above 100 are clamped.
int32 progress;
int32 progress@13;
// Status message for type kProgress.
mojo_base.mojom.String16 progress_status;
mojo_base.mojom.String16 progress_status@14;
// Up to 4 buttons. It is not guaranteed that all buttons will be visible,
// especially if the labels are long.
array<ButtonInfo> buttons;
array<ButtonInfo> buttons@15;
// Pinned notifications cannot be closed by the user, only by a call to
// MessageCenter::CloseNotification.
bool pinned;
bool pinned@16;
// Whether an announcement should occur (e.g. a popup or vibration) when an
// existing notification is updated. See web platform API
// Notification.renotify.
bool renotify;
bool renotify@17;
// Whether all announcement mechanisms should be suppressed. See web platform
// API Notification.silent.
bool silent;
bool silent@18;
// Accessible description of the notification's contents. If empty, the
// message field will be used instead.
mojo_base.mojom.String16 accessible_name;
mojo_base.mojom.String16 accessible_name@19;
// Whether to show on top of fullscreen windows. See enum definition.
FullscreenVisibility fullscreen_visibility;
FullscreenVisibility fullscreen_visibility@20;
// Icon for the notification.
[MinVersion=1]
gfx.mojom.ImageSkia? icon;
gfx.mojom.ImageSkia? icon@21;
// For type kImage, the large image.
[MinVersion=1]
gfx.mojom.ImageSkia? image;
gfx.mojom.ImageSkia? image@22;
// Badge to show the source of the notification (e.g. a 16x16 browser icon).
[MinVersion=1]
gfx.mojom.ImageSkia? badge;
gfx.mojom.ImageSkia? badge@23;
};
......@@ -55,49 +55,49 @@ struct SelectFileTypeInfo {
// { { "htm", "html" }, { "txt" } }
// Only pass more than one extension in the inner vector if the extensions
// are equivalent.
array<array<string>> extensions;
array<array<string>> extensions@0;
// Overrides the system descriptions of specified extensions. For example,
// when saving a web page, "Webpage, HTML only" is used for {"htm", "html"}
// and "Webpage, Single File" is used for {"mhtml"}. Length must match the
// length of |extensions|. If empty or if the length doesn't match then
// the system descriptions will be used.
array<mojo_base.mojom.String16> extension_description_overrides;
array<mojo_base.mojom.String16> extension_description_overrides@1;
// One-based index of the file type (in the extensions list) to select by
// default. Zero means no selection. (The index is one-based for consistency
// with the C++ code and because mojo doesn't allow nullable primitive types.)
// For example, when saving a web page, we use the index of {"mhtml"} so the
// user sees "Webpage, Single File" as the default choice.
int32 default_file_type_index;
int32 default_file_type_index@2;
// Whether or not there will be a filter added for all files (*.*).
bool include_all_files;
bool include_all_files@3;
// Types of paths/volumes allowed. Unrelated to file extensions.
AllowedPaths allowed_paths;
AllowedPaths allowed_paths@4;
};
// Options for the select file dialog.
[Stable]
struct SelectFileOptions {
// Dialog type.
SelectFileDialogType type;
SelectFileDialogType type@0;
// Window title.
mojo_base.mojom.String16 title;
mojo_base.mojom.String16 title@1;
// Default path to open.
mojo_base.mojom.FilePath default_path;
mojo_base.mojom.FilePath default_path@2;
// Optional file type configuration. In the common case for file open (Ctrl-O)
// this is null.
SelectFileTypeInfo? file_types;
SelectFileTypeInfo? file_types@3;
// Internal window ID for the top-level shell window that owns the dialog.
// If provided, the dialog will be window-modal to that shell window.
// If empty, a modeless dialog will be opened on the default display.
string owning_shell_window_id;
string owning_shell_window_id@4;
};
// Result of the select file dialog.
......@@ -114,24 +114,24 @@ enum SelectFileResult {
[Stable]
struct SelectedFileInfo {
// Path to the file, as seen in the UI.
mojo_base.mojom.FilePath file_path;
mojo_base.mojom.FilePath file_path@0;
// The actual local path to the selected file. This can be a snapshot file
// with a human unreadable name like /blah/.d41d8cd98f00b204e9800998ecf8427e.
// |local_path| can differ from |file_path| for drive files (e.g.
// /drive_cache/temporary/d41d8cd98f00b204e9800998ecf8427e vs.
// /special/drive/foo.txt).
mojo_base.mojom.FilePath local_path;
mojo_base.mojom.FilePath local_path@1;
// Optional display name of the file. UTF-8 encoded. If empty, the UI should
// display the base name portion of |file_path|.
string display_name;
string display_name@2;
// Optional URL to access the file. If the caller can use a URL to access a
// file, |url| should be used instead of |local_path|. For example, when
// opening a .gdoc file from Google Drive the |local_path| is a placeholder
// file that should be "opened" by navigating to docs.google.com.
url.mojom.Url? url;
url.mojom.Url? url@3;
};
// Select file dialog interface. Wrapper around the C++ SelectFileDialog
......
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