dlp.mojom 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright 2021 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 "mojo/public/mojom/base/string16.mojom";
  6. import "url/mojom/url.mojom";
  7. // Corresponds to DlpRulesManager::Level enum.
  8. [Stable, Extensible]
  9. enum DlpRestrictionLevel {
  10. kAllow = 0,
  11. kReport = 1,
  12. kWarn = 2,
  13. kBlock = 3,
  14. [MinVersion=2] kNotSet = 4,
  15. };
  16. // Corresponds to RestrictionLevelAndUrl struct.
  17. [Stable]
  18. struct DlpRestrictionLevelAndUrl {
  19. DlpRestrictionLevel level@0;
  20. url.mojom.Url url@1;
  21. };
  22. // Corresponds to DlpContentRestrictionSet class.
  23. [Stable]
  24. struct DlpRestrictionSet {
  25. DlpRestrictionLevelAndUrl screenshot@0;
  26. DlpRestrictionLevelAndUrl privacy_screen@1;
  27. DlpRestrictionLevelAndUrl print@2;
  28. DlpRestrictionLevelAndUrl screen_share@3;
  29. };
  30. // Captured area.
  31. [Stable]
  32. struct ScreenShareArea {
  33. // All root windows if |window_id| is null.
  34. string? window_id@0;
  35. // Unique identifier for a window from SnapshotSource in screen_manager.mojom.
  36. [MinVersion=3] uint64 snapshot_source_id@1 = 0;
  37. };
  38. // Callback to control the state (pause/resume) of a remote screen share.
  39. [Stable]
  40. interface StateChangeDelegate {
  41. // Request to pause the screen share.
  42. OnPause@0();
  43. // Request to resume the screen share.
  44. OnResume@1();
  45. // Request to stop the screen share. Should be called only once.
  46. OnStop@2();
  47. };
  48. // Interface to communicate from Lacros DLP layer to Ash. Used to notify Ash
  49. // about changes in restrictions applied to web content in Lacros.
  50. //
  51. // Next MinVersion: 4
  52. // Next ID: 4
  53. [Stable, Uuid="793ee9c6-3873-4ea8-a541-894412ddfc0b"]
  54. interface Dlp {
  55. // Called when |restrictions| are changed for window with |window_id|.
  56. DlpRestrictionsUpdated@0(string window_id, DlpRestrictionSet restrictions);
  57. // Called to evaluate screenshare restriction for a window or full screen.
  58. [MinVersion=1] CheckScreenShareRestriction@1(
  59. ScreenShareArea area, mojo_base.mojom.String16 application_title) =>
  60. (bool proceed);
  61. // Called when screen share in Lacros is started.
  62. [MinVersion=2] OnScreenShareStarted@2(string label, ScreenShareArea area,
  63. mojo_base.mojom.String16 application_title,
  64. pending_remote<StateChangeDelegate> delegate);
  65. // Called when screen share in Lacros is stopped.
  66. [MinVersion=2] OnScreenShareStopped@3(string label, ScreenShareArea area);
  67. };