blob: 3afd167482c9cc8bc5dced23458266d771fd7462 [file] [log] [blame]
// 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;
}
// 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;
BADGE_ICON_HASH_DIFFERS = 4;
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;
}
// 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;
// The reason that a WebAPK update is requested.
optional UpdateReason update_reason = 10;
reserved 4;
}
// 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;
reserved 3, 7, 8, 13 to 16;
}
message Image {
enum Usage {
PRIMARY_ICON = 1;
BADGE_ICON = 2;
}
// 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;
// Specifies Chrome's intended usages for the image.
repeated Usage usages = 8;
reserved 2, 3, 4, 7;
}
// A proto representing a ShareTargetParamsFile
// https://pr-preview.s3.amazonaws.com/ewilligers/web-share-target/pull/53.html#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://wicg.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;
}