blob: 0c60dda37368f299ca3c02d0bbb4a8df2cddd93b [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/web_applications/proto/web_app_share_target.proto";
import "chrome/browser/web_applications/system_web_apps/system_web_app_data.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;
}
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.
message SourcesProto {
required bool system = 1;
required bool policy = 2;
required bool web_app_store = 3;
required bool sync = 4;
required bool default = 5;
}
// 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;
}
message ClientDataProto {
optional 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_icon_infos = 3;
repeated sync_pb.WebAppIconInfo shortcut_icon_infos_maskable = 4;
}
// 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;
}
// 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 {
// 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;
}
// 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;
optional bool is_in_sync_install = 9;
// A list of icon infos.
repeated sync_pb.WebAppIconInfo icon_infos = 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_maskable|.
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/components/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 |ManifestCaptureLinks| in
// third_party/blink/public/mojom/manifest/manifest.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;
}