web_app_service.mojom 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Copyright 2022 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. module crosapi.mojom;
  5. import "chromeos/crosapi/mojom/web_app_types.mojom";
  6. // Describes an Android package associated with a web app.
  7. [Stable]
  8. struct WebAppAndroidPackage {
  9. // Android package name.
  10. string package_name@0;
  11. // SHA256 fingerprint of the certificate of this Android app.
  12. string sha256_fingerprint@1;
  13. };
  14. // Contains the web app information used to mint an Android WebApk.
  15. [Stable]
  16. struct WebApkCreationParams {
  17. // The URL of the Web App Manifest.
  18. string manifest_url@0;
  19. // A serialized webapk::WebAppManifest proto containing the information
  20. // required for an Android WebApk to be minted.
  21. array<uint8> webapk_manifest_proto_bytes@1;
  22. };
  23. // Implemented in lacros-chrome. Allows ash-chrome to modify web app state in
  24. // lacros-chrome.
  25. // Next version: 2
  26. // Next method id: 3
  27. [Stable, Uuid="84eb46eb-76fe-439c-9fcb-3388492e141d"]
  28. interface WebAppProviderBridge {
  29. // Called when a web app described by |info| is installed in ARC (Android
  30. // package containing web app metadata) and installs this web app in the
  31. // primary profile of Lacros.
  32. // See |web_app::WebAppInstallManager::InstallWebAppFromInfo|.
  33. WebAppInstalledInArc@0(ArcWebAppInstallInfo info)
  34. => (string app_id, WebAppInstallResultCode install_result);
  35. // Removes ARC as an install source from the app specified by |app_id|, and
  36. // uninstalls the app from the primary profile of Lacros if no other sources
  37. // are left.
  38. // See |web_app::WebAppInstallFinalizer::UninstallExternalWebApp|.
  39. WebAppUninstalledInArc@1(string app_id)
  40. => (WebAppUninstallResultCode uninstall_result);
  41. // Called when a web app defining a share target has been installed in Lacros.
  42. // Returns the information required for an Android WebApk to be minted.
  43. [MinVersion=1]
  44. GetWebApkCreationParams@2(string app_id)
  45. => (WebApkCreationParams webapk_creation_params);
  46. };
  47. // An interface implemented in ash-chrome. Allows lacros-chrome:
  48. // 1) to query web-app-related information in ash-chrome,
  49. // 2) to register its own |crosapi::mojom::WebAppProviderBridge| to let
  50. // ash-chrome to modify or query WebAppProvider in lacros-chrome.
  51. //
  52. // Next version: 2
  53. // Next method id: 2
  54. [Stable, Uuid="dfa7b3f8-236f-4706-861b-98068aa5fc8f"]
  55. interface WebAppService {
  56. // Register a web app provider bridge that lets ash-chrome to update or query
  57. // WebAppProvider in lacros-chrome.
  58. RegisterWebAppProviderBridge@0(
  59. pending_remote<WebAppProviderBridge> web_app_provider_bridge);
  60. // Gets the information about an Android package matching this web app, if
  61. // this app was installed from the Play Store. Returns null if the app was not
  62. // installed from the Play Store.
  63. [MinVersion=1]
  64. GetAssociatedAndroidPackage@1(string web_app_id)
  65. => (WebAppAndroidPackage? package);
  66. };