123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- // Copyright 2016 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";
- option optimize_for = LITE_RUNTIME;
- package webapk;
- // Response after creating or updating a WebAPK.
- message WebApkResponse {
- // Package name to install WebAPK at.
- optional string package_name = 1;
- // Version code of the WebAPK.
- optional string version = 2;
- // Unique id identifying session with WebAPK server.
- optional string token = 6;
- // This flag may be used, for example, if the WebAPK server is unable to
- // fulfill an update request and likely won't be able to fulfill subsequent
- // update requests from this WebAPK. One case where the server is unable to
- // fulfill update requests is if the Web Manifest is dynamically generated
- // based on the user's country etc. Therefore, we want the client to back off
- // from spamming update requests too often.
- optional bool relax_updates = 8;
- reserved 3, 4, 5, 7, 9;
- }
- // Sent as part of request to create or update a WebAPK.
- message WebApk {
- enum UpdateReason {
- NONE = 1;
- OLD_SHELL_APK = 2;
- PRIMARY_ICON_HASH_DIFFERS = 3;
- SCOPE_DIFFERS = 5;
- START_URL_DIFFERS = 6;
- SHORT_NAME_DIFFERS = 7;
- NAME_DIFFERS = 8;
- BACKGROUND_COLOR_DIFFERS = 9;
- THEME_COLOR_DIFFERS = 10;
- ORIENTATION_DIFFERS = 11;
- DISPLAY_MODE_DIFFERS = 12;
- WEB_SHARE_TARGET_DIFFERS = 13;
- MANUALLY_TRIGGERED = 14;
- PRIMARY_ICON_MASKABLE_DIFFERS = 15;
- SHORTCUTS_DIFFER = 16;
- SPLASH_ICON_HASH_DIFFERS = 17;
- reserved 4;
- }
- // Package name of the WebAPK.
- optional string package_name = 1;
- // Version code of the WebAPK.
- optional string version = 2;
- // The URL of the Web App Manifest.
- optional string manifest_url = 3;
- // Chrome's package name.
- optional string requester_application_package = 5;
- // Chrome's version.
- optional string requester_application_version = 6;
- // The Web App Manifest.
- optional WebAppManifest manifest = 7;
- // The cpu abi of the browser making the request.
- optional string android_abi = 8;
- // If set true, this flag indicates that the Web App Manifest of the site is
- // no longer available.
- optional bool stale_manifest = 9;
- // A list of all reasons why the WebAPK needs to be updated.
- repeated UpdateReason update_reasons = 11;
- // The Android OS version (e.g '11').
- optional string android_version = 12;
- // Whether this builds supports app identity updates via dialog.
- optional bool app_identity_update_supported = 13;
- // The key used for identifiing a WebAPK.
- optional string app_key = 14;
- reserved 4, 10;
- }
- // Contains data from the Web App Manifest.
- message WebAppManifest {
- optional string name = 1;
- optional string short_name = 2;
- optional string start_url = 4;
- repeated string scopes = 5;
- repeated Image icons = 6;
- optional string orientation = 9;
- optional string display_mode = 10;
- optional string theme_color = 11;
- optional string background_color = 12;
- repeated ShareTarget share_targets = 17;
- repeated ShortcutItem shortcuts = 18;
- optional string id = 19;
- reserved 3, 7, 8, 13 to 16;
- }
- message Image {
- enum Usage {
- PRIMARY_ICON = 1;
- BADGE_ICON = 2;
- SPLASH_ICON = 3;
- }
- // Image's URL.
- optional string src = 1;
- // Murmur2 hash of the icon's bytes. There should not be any transformations
- // applied to the icon's bytes prior to taking the Murmur2 hash.
- optional string hash = 5;
- // Actual bytes of the image. This image may be re-encoded from the original
- // image and may not match the murmur2 hash field above.
- optional bytes image_data = 6;
- // Possible purposes that an icon can be used for.
- enum Purpose {
- // Missing purpose.
- PURPOSE_UNDEFINED = 0;
- // The icon can be displayed in any context.
- ANY = 1;
- // The icon can be used where a monochrome icon with a solid fill is needed.
- // MONOCHROME = 2; This is not currently used, so ignore it.
- // The icon is designed with the intention to be masked.
- MASKABLE = 3;
- reserved 2;
- }
- // The purposes this image may be used for.
- repeated Purpose purposes = 7;
- // Specifies Chrome's intended usages for the image.
- repeated Usage usages = 8;
- reserved 2, 3, 4, 9;
- }
- // A proto representing a ShareTargetParamsFile
- // https://wicg.github.io/web-share-target/level-2/#sharetargetfiles-and-its-members
- message ShareTargetParamsFile {
- optional string name = 1;
- repeated string accept = 2;
- }
- // A proto representing ShareTargetParams
- // https://wicg.github.io/web-share-target/#dom-sharetargetparams
- // Each field corresponds to key in ShareData. These are the query parameter
- // keys to be used for the data supplied in a ShareData instance.
- // ShareData: https://w3c.github.io/web-share#dom-sharedata
- message ShareTargetParams {
- optional string title = 1;
- optional string text = 2;
- optional string url = 3;
- repeated ShareTargetParamsFile files = 4;
- }
- // A proto representing a ShareTarget.
- // https://wicg.github.io/web-share-target/#dom-sharetarget
- message ShareTarget {
- // The URL to be resolved when sharing.
- optional string action = 2;
- optional ShareTargetParams params = 3;
- optional string method = 4;
- optional string enctype = 5;
- reserved 1;
- }
- message ShortcutItem {
- optional string name = 1;
- optional string short_name = 2;
- optional string url = 3;
- repeated Image icons = 4;
- }
|