blob: fac1e6ee9e6767a389583448dd14b38785a3d813 [file] [log] [blame]
// Copyright 2018 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.
syntax = "proto2";
import "components/sync/protocol/web_app_specifics.proto";
import "chrome/browser/ash/system_web_apps/types/system_web_app_data.proto";
import "chrome/browser/web_applications/proto/web_app_launch_handler.proto";
import "chrome/browser/web_applications/proto/web_app_share_target.proto";
import "chrome/browser/web_applications/proto/web_app_tab_strip.proto";
option optimize_for = LITE_RUNTIME;
package web_app;
// A mapping between a MIME type and a set of file extensions for a file handler
// "accept" entry. See chrome/browser/web_applications/web_app.h for details.
message WebAppFileHandlerAcceptProto {
required string mimetype = 1;
repeated string file_extensions = 2;
}
// A file handler "action" associated with a set of "accept" entries, each of
// which specifies a MIME type and corresponding set of file extensions that the
// handler can handle. See chrome/browser/web_applications/web_app.h for
// details.
message WebAppFileHandlerProto {
required string action = 1;
repeated WebAppFileHandlerAcceptProto accept = 2;
repeated sync_pb.WebAppIconInfo downloaded_icons = 3;
optional string display_name = 4;
// This enum should be synced with `LaunchType` in `apps::FileHandler`.
enum LaunchType {
UNDEFINED = 0;
SINGLE_CLIENT = 1;
MULTIPLE_CLIENTS = 2;
}
required LaunchType launch_type = 5;
}
message WebAppProtocolHandler {
required string protocol = 1;
required string url = 2;
}
message WebAppUrlHandlerProto {
required string origin = 1;
required bool has_origin_wildcard = 2;
}
// A set to track simultaneous installs and uninstalls from multiple install
// sources. This should stay in sync with |WebAppManagement| in
// chrome/browser/web_applications/web_app_constants.h
// and the WebAppManagementProto enum below.
message SourcesProto {
required bool system = 1;
required bool policy = 2;
required bool web_app_store = 3;
required bool sync = 4;
required bool default = 5;
optional bool sub_app = 6;
}
// Properties for integrating with Chrome OS UI surfaces.
message ChromeOSDataProto {
required bool show_in_launcher = 1;
required bool show_in_search = 2;
required bool show_in_management = 3;
required bool is_disabled = 4;
optional bool oem_installed = 5;
optional bool handles_file_open_intents = 6;
}
message ClientDataProto {
optional ash.SystemWebAppDataProto system_web_app_data = 1;
}
// Properties for a WebApp's shortcuts menu item.
message WebAppShortcutsMenuItemInfoProto {
required string name = 1;
required string url = 2;
repeated sync_pb.WebAppIconInfo shortcut_manifest_icons = 3;
repeated sync_pb.WebAppIconInfo shortcut_manifest_icons_maskable = 4;
repeated sync_pb.WebAppIconInfo shortcut_manifest_icons_monochrome = 5;
}
// List of icon sizes downloaded to disk for a shortcuts menu item.
message DownloadedShortcutsMenuIconSizesProto {
repeated int32 icon_sizes = 1;
repeated int32 icon_sizes_maskable = 2;
repeated int32 icon_sizes_monochrome = 3;
}
message WebAppPermissionsPolicy {
optional string feature = 1;
repeated string allowed_origins = 2;
optional bool matches_all_origins = 3;
optional bool matches_opaque_src = 4;
}
// This enum should be synced with |WebAppManagement| in
// chrome/browser/web_applications/web_app_constants.h as well as
// with the SourcesProto message defined above.
enum WebAppManagementProto {
WEBAPPMANAGEMENT_UNSPECIFIED = 0;
SYSTEM = 1;
POLICY = 2;
SUBAPP = 3;
WEBAPPSTORE = 4;
SYNC = 5;
DEFAULT = 6;
}
message ManagementToExternalConfigInfo {
optional WebAppManagementProto management = 1;
// The collection of install_urls per web_app per WebAppManagement::Type.
repeated string install_urls = 2;
// Stores whether the app is a placeholder app or not.
optional bool is_placeholder = 3;
}
// Full WebApp object data. See detailed comments in
// chrome/browser/web_applications/web_app.h. Note on database identities:
// app_id is a hash of launch_url. app_id is the client tag for sync system.
// app_id is the storage key in ModelTypeStore.
message WebAppProto {
reserved "handle_links", "is_in_sync_install", "is_placeholder";
// Synced data. It is replicated across all devices with WEB_APPS.
//
// |sync_data.name| and |sync_data.theme_color| are read by a device to
// generate a placeholder icon. Any device may write new values to synced
// |name| and |theme_color|. A random last update wins.
required sync_pb.WebAppSpecifics sync_data = 1;
// This enum should be synced with
// third_party/blink/public/mojom/manifest/display_mode.mojom
enum DisplayMode {
// UNDEFINED if optional |display_mode| is absent.
BROWSER = 1;
MINIMAL_UI = 2;
STANDALONE = 3;
FULLSCREEN = 4;
WINDOW_CONTROLS_OVERLAY = 5;
TABBED = 6;
}
// Local data. May vary across devices. Not to be synced.
//
required string name = 2;
optional uint32 theme_color = 3;
optional string description = 4;
optional DisplayMode display_mode = 5;
optional string scope = 6;
required SourcesProto sources = 7;
required bool is_locally_installed = 8;
// Installation state:
// Specifies if this web app is from sync and has not completed installation.
// If true, this entity will be re-installed on startup.
optional bool is_from_sync_and_pending_installation = 9;
repeated sync_pb.WebAppIconInfo manifest_icons = 10;
// A list of icon sizes we successfully downloaded to store on disk, for icons
// that are suitable for any purpose (ie. IconPurpose::ANY). See also:
// |downloaded_icon_sizes_purpose_monochrome|.
repeated int32 downloaded_icon_sizes_purpose_any = 11;
// A list of file handlers.
repeated WebAppFileHandlerProto file_handlers = 12;
// A list of additional search terms to use when searching for the app.
repeated string additional_search_terms = 13;
// Even though |chromeos_data| is optional, it should always exist on
// ChromeOS.
optional ChromeOSDataProto chromeos_data = 14;
// Last time the app is launched.
// ms since the Unix epoch. See sync/base/time.h.
optional int64 last_launch_time = 15;
// Time the app is installed.
// ms since the Unix epoch. See sync/base/time.h.
optional int64 install_time = 16;
// A list of protocol handlers.
repeated WebAppProtocolHandler protocol_handlers = 17;
// Represents whether the icons for the web app are generated by Chrome due to
// no suitable icons being available.
optional bool is_generated_icon = 18;
// A list of Shortcuts Menu items specified in the Web App Manifest.
repeated WebAppShortcutsMenuItemInfoProto shortcuts_menu_item_infos = 19;
// A list of icon sizes we successfully downloaded to store on disk.
repeated DownloadedShortcutsMenuIconSizesProto
downloaded_shortcuts_menu_icons_sizes = 20;
optional uint32 background_color = 21;
// A list of display modes specified in app manifest.
repeated DisplayMode display_mode_override = 22;
// A list of icon sizes we successfully downloaded to store on disk, for icons
// that are designed for masking (ie. IconPurpose::MASKABLE). See also:
// |downloaded_icon_sizes_purpose_any|.
repeated int32 downloaded_icon_sizes_purpose_maskable = 23;
// Run on OS Login modes for web app.
// See chrome/browser/web_applications/web_app_constants.h
// for web_app::RunOnOsLoginMode definition, which this enum should be in sync
// with.
enum RunOnOsLoginMode {
// NOT_RUN if optional |user_run_on_os_login_mode| is absent.
NOT_RUN = 0;
WINDOWED = 1;
MINIMIZED = 2;
}
// User preference: Run on OS Login mode for web app.
// If present, the web app is configured to run on OS login.
optional RunOnOsLoginMode user_run_on_os_login_mode = 24;
optional ShareTarget share_target = 25;
optional string launch_query_params = 26;
repeated WebAppUrlHandlerProto url_handlers = 27;
optional ClientDataProto client_data = 28;
// This enum should be synced with |CaptureLinks| in
// third_party/blink/public/mojom/manifest/capture_links.mojom
enum CaptureLinks {
// UNDEFINED if optional |capture_links| is absent.
NONE = 1;
NEW_CLIENT = 2;
EXISTING_CLIENT_NAVIGATE = 3;
}
optional CaptureLinks capture_links = 29;
optional string manifest_url = 30;
// Last time the Badging API was used.
// ms since the Unix epoch. See sync/base/time.h.
optional int64 last_badging_time = 31;
optional bool file_handler_permission_blocked = 32;
// A list of icon sizes we successfully downloaded to store on disk for
// monochrome icons. (IconPurpose::MONOCHROME). See also:
// |downloaded_icon_sizes_purpose_any|,
// |downloaded_icon_sizes_purpose_maskable|.
repeated int32 downloaded_icon_sizes_purpose_monochrome = 33;
optional bool window_controls_overlay_enabled = 34;
// If present, the URL to use to create a new note in the app.
optional string note_taking_new_note_url = 35;
// Whether the app should be loaded in a dedicated storage partition.
optional bool is_storage_isolated = 36;
// A list of allowed launch protocols when launching the app with a protocol
// url. This list is checked to see if we can bypass the permission dialog
// when launching the web app.
repeated string allowed_launch_protocols = 37;
optional LaunchHandlerProto launch_handler = 38;
// Time the app is updated.
// ms since the Unix epoch. See sync/base/time.h.
optional int64 manifest_update_time = 39;
// A list of disallowed launch protocols. The user has elected to never
// allow these protocols be launched in the web app.
repeated string disallowed_launch_protocols = 40;
// A theme color to be used when the app is opened in dark mode.
optional uint32 dark_mode_theme_color = 41;
// Should be kept in sync with `ApiApprovalState` in web_app_constants.h.
enum ApiApprovalState {
REQUIRES_PROMPT = 0;
ALLOWED = 1;
DISALLOWED = 2;
}
optional ApiApprovalState file_handler_approval_state = 42;
// For apps installed via the SubApp API, ID of the parent app that installed
// the Sub-app.
optional string parent_app_id = 43;
// A background color to be used when the app is opened in dark mode.
optional uint32 dark_mode_background_color = 44;
// Specifies if this web app is currently being uninstalled. If true on
// startup, it's assumed there was a crash or other error during
// uninstallation, and the uninstallation will be tried again.
optional bool is_uninstalling = 45;
// Should be kept in sync with `OsIntegrationState` in web_app_constants.h.
enum OsIntegrationState {
ENABLED = 0;
DISABLED = 1;
}
// Whether the file handling abilities of the app should be registered with
// the OS.
optional OsIntegrationState file_handler_os_integration_state = 46;
// Whether the app should show up in file-open intent and picking surfaces.
optional bool handles_file_open_intents = 47;
reserved 48;
// Contains the permissions policy that should be applied to the web app.
repeated WebAppPermissionsPolicy permissions_policy = 49;
// The precise source of the latest install, used for metrics purposes. The
// meaning of the value aligns with `webapps::WebappInstallSource`.
optional uint32 install_source_for_metrics = 50;
// Whether the app should be registered to run during OS Login time.
optional RunOnOsLoginMode run_on_os_login_os_integration_state = 51;
// Map of WebAppManagement enum to placeholder info and install_urls.
// There should be only one entry per WebAppManagement source.
repeated ManagementToExternalConfigInfo management_to_external_config_info =
52;
reserved 53;
// The amount of storage (in bytes) used by the app and its related data.
optional uint64 app_size_in_bytes = 54;
optional uint64 data_size_in_bytes = 55;
// If present, the URL to use to launch the app on the lock screen.
optional string lock_screen_start_url = 56;
// Contains customisations to the web app tab strip. Only present when the
// display_mode is tabbed.
optional proto.TabStrip tab_strip = 57;
}