webapk.proto 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. syntax = "proto2";
  5. option optimize_for = LITE_RUNTIME;
  6. package webapk;
  7. // Response after creating or updating a WebAPK.
  8. message WebApkResponse {
  9. // Package name to install WebAPK at.
  10. optional string package_name = 1;
  11. // Version code of the WebAPK.
  12. optional string version = 2;
  13. // Unique id identifying session with WebAPK server.
  14. optional string token = 6;
  15. // This flag may be used, for example, if the WebAPK server is unable to
  16. // fulfill an update request and likely won't be able to fulfill subsequent
  17. // update requests from this WebAPK. One case where the server is unable to
  18. // fulfill update requests is if the Web Manifest is dynamically generated
  19. // based on the user's country etc. Therefore, we want the client to back off
  20. // from spamming update requests too often.
  21. optional bool relax_updates = 8;
  22. reserved 3, 4, 5, 7, 9;
  23. }
  24. // Sent as part of request to create or update a WebAPK.
  25. message WebApk {
  26. enum UpdateReason {
  27. NONE = 1;
  28. OLD_SHELL_APK = 2;
  29. PRIMARY_ICON_HASH_DIFFERS = 3;
  30. SCOPE_DIFFERS = 5;
  31. START_URL_DIFFERS = 6;
  32. SHORT_NAME_DIFFERS = 7;
  33. NAME_DIFFERS = 8;
  34. BACKGROUND_COLOR_DIFFERS = 9;
  35. THEME_COLOR_DIFFERS = 10;
  36. ORIENTATION_DIFFERS = 11;
  37. DISPLAY_MODE_DIFFERS = 12;
  38. WEB_SHARE_TARGET_DIFFERS = 13;
  39. MANUALLY_TRIGGERED = 14;
  40. PRIMARY_ICON_MASKABLE_DIFFERS = 15;
  41. SHORTCUTS_DIFFER = 16;
  42. SPLASH_ICON_HASH_DIFFERS = 17;
  43. reserved 4;
  44. }
  45. // Package name of the WebAPK.
  46. optional string package_name = 1;
  47. // Version code of the WebAPK.
  48. optional string version = 2;
  49. // The URL of the Web App Manifest.
  50. optional string manifest_url = 3;
  51. // Chrome's package name.
  52. optional string requester_application_package = 5;
  53. // Chrome's version.
  54. optional string requester_application_version = 6;
  55. // The Web App Manifest.
  56. optional WebAppManifest manifest = 7;
  57. // The cpu abi of the browser making the request.
  58. optional string android_abi = 8;
  59. // If set true, this flag indicates that the Web App Manifest of the site is
  60. // no longer available.
  61. optional bool stale_manifest = 9;
  62. // A list of all reasons why the WebAPK needs to be updated.
  63. repeated UpdateReason update_reasons = 11;
  64. // The Android OS version (e.g '11').
  65. optional string android_version = 12;
  66. // Whether this builds supports app identity updates via dialog.
  67. optional bool app_identity_update_supported = 13;
  68. // The key used for identifiing a WebAPK.
  69. optional string app_key = 14;
  70. reserved 4, 10;
  71. }
  72. // Contains data from the Web App Manifest.
  73. message WebAppManifest {
  74. optional string name = 1;
  75. optional string short_name = 2;
  76. optional string start_url = 4;
  77. repeated string scopes = 5;
  78. repeated Image icons = 6;
  79. optional string orientation = 9;
  80. optional string display_mode = 10;
  81. optional string theme_color = 11;
  82. optional string background_color = 12;
  83. repeated ShareTarget share_targets = 17;
  84. repeated ShortcutItem shortcuts = 18;
  85. optional string id = 19;
  86. reserved 3, 7, 8, 13 to 16;
  87. }
  88. message Image {
  89. enum Usage {
  90. PRIMARY_ICON = 1;
  91. BADGE_ICON = 2;
  92. SPLASH_ICON = 3;
  93. }
  94. // Image's URL.
  95. optional string src = 1;
  96. // Murmur2 hash of the icon's bytes. There should not be any transformations
  97. // applied to the icon's bytes prior to taking the Murmur2 hash.
  98. optional string hash = 5;
  99. // Actual bytes of the image. This image may be re-encoded from the original
  100. // image and may not match the murmur2 hash field above.
  101. optional bytes image_data = 6;
  102. // Possible purposes that an icon can be used for.
  103. enum Purpose {
  104. // Missing purpose.
  105. PURPOSE_UNDEFINED = 0;
  106. // The icon can be displayed in any context.
  107. ANY = 1;
  108. // The icon can be used where a monochrome icon with a solid fill is needed.
  109. // MONOCHROME = 2; This is not currently used, so ignore it.
  110. // The icon is designed with the intention to be masked.
  111. MASKABLE = 3;
  112. reserved 2;
  113. }
  114. // The purposes this image may be used for.
  115. repeated Purpose purposes = 7;
  116. // Specifies Chrome's intended usages for the image.
  117. repeated Usage usages = 8;
  118. reserved 2, 3, 4, 9;
  119. }
  120. // A proto representing a ShareTargetParamsFile
  121. // https://wicg.github.io/web-share-target/level-2/#sharetargetfiles-and-its-members
  122. message ShareTargetParamsFile {
  123. optional string name = 1;
  124. repeated string accept = 2;
  125. }
  126. // A proto representing ShareTargetParams
  127. // https://wicg.github.io/web-share-target/#dom-sharetargetparams
  128. // Each field corresponds to key in ShareData. These are the query parameter
  129. // keys to be used for the data supplied in a ShareData instance.
  130. // ShareData: https://w3c.github.io/web-share#dom-sharedata
  131. message ShareTargetParams {
  132. optional string title = 1;
  133. optional string text = 2;
  134. optional string url = 3;
  135. repeated ShareTargetParamsFile files = 4;
  136. }
  137. // A proto representing a ShareTarget.
  138. // https://wicg.github.io/web-share-target/#dom-sharetarget
  139. message ShareTarget {
  140. // The URL to be resolved when sharing.
  141. optional string action = 2;
  142. optional ShareTargetParams params = 3;
  143. optional string method = 4;
  144. optional string enctype = 5;
  145. reserved 1;
  146. }
  147. message ShortcutItem {
  148. optional string name = 1;
  149. optional string short_name = 2;
  150. optional string url = 3;
  151. repeated Image icons = 4;
  152. }