sharesheet.mojom 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/app_service_types.mojom";
  6. // The source from which the sharesheet was launched from.
  7. // Based on sharesheet::LaunchSource.
  8. [Stable, Extensible]
  9. enum SharesheetLaunchSource {
  10. [Default] kUnknown = 0,
  11. kWebShare = 3,
  12. kOmniboxShare = 5,
  13. };
  14. // The result from showing a sharesheet bubble.
  15. [Stable, Extensible]
  16. enum SharesheetResult {
  17. kSuccess, // Successfully passed data to selected target.
  18. kCancel, // Share was cancelled before completion.
  19. kErrorAlreadyOpen, // Share failed because the sharesheet is already open.
  20. kErrorWindowClosed, // Parent window closed before sharesheet could be shown.
  21. };
  22. // Interacts with the Sharesheet service. Implemented in ash-chrome.
  23. // Next version: 2
  24. // Next method id: 3
  25. [Stable, Uuid="be0b8049-1fdd-4ba7-a980-997b8c59420e"]
  26. interface Sharesheet {
  27. // Displays the dialog (aka bubble) for sharing content (or files) with
  28. // other applications and targets. |intent| contains the list of the
  29. // files/content to be shared.
  30. ShowBubble@0(
  31. string window_id,
  32. SharesheetLaunchSource source,
  33. Intent intent) => (SharesheetResult sharesheet_result);
  34. // Functions like ShowBubble(), except this invokes a callback when the bubble
  35. // is closed instead of SharesheetResult.
  36. [MinVersion=1] ShowBubbleWithOnClosed@1(
  37. string window_id,
  38. SharesheetLaunchSource source,
  39. Intent intent) => ();
  40. // Closes the Sharesheet dialog associated with the window ID.
  41. [MinVersion=1] CloseBubble@2(string window_id);
  42. };