blob: 51f2c263a8e88716a24fc03ac7d427cd151921fc [file] [log] [blame]
// Copyright 2021 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.
module crosapi.mojom;
import "mojo/public/mojom/base/string16.mojom";
import "url/mojom/url.mojom";
// Corresponds to DlpRulesManager::Level enum.
[Stable, Extensible]
enum DlpRestrictionLevel {
kAllow = 0,
kReport = 1,
kWarn = 2,
kBlock = 3,
[MinVersion=2] kNotSet = 4,
};
// Corresponds to RestrictionLevelAndUrl struct.
[Stable]
struct DlpRestrictionLevelAndUrl {
DlpRestrictionLevel level@0;
url.mojom.Url url@1;
};
// Corresponds to DlpContentRestrictionSet class.
[Stable]
struct DlpRestrictionSet {
DlpRestrictionLevelAndUrl screenshot@0;
DlpRestrictionLevelAndUrl privacy_screen@1;
DlpRestrictionLevelAndUrl print@2;
DlpRestrictionLevelAndUrl screen_share@3;
};
// Captured area.
[Stable]
struct ScreenShareArea {
// All root windows if |window_id| is null.
string? window_id@0;
// Unique identifier for a window from SnapshotSource in screen_manager.mojom.
[MinVersion=3] uint64 snapshot_source_id@1 = 0;
};
// Callback to control the state (pause/resume) of a remote screen share.
[Stable]
interface StateChangeDelegate {
// Request to pause the screen share.
OnPause@0();
// Request to resume the screen share.
OnResume@1();
// Request to stop the screen share. Should be called only once.
OnStop@2();
};
// Interface to communicate from Lacros DLP layer to Ash. Used to notify Ash
// about changes in restrictions applied to web content in Lacros.
//
// Next MinVersion: 4
// Next ID: 4
[Stable, Uuid="793ee9c6-3873-4ea8-a541-894412ddfc0b"]
interface Dlp {
// Called when |restrictions| are changed for window with |window_id|.
DlpRestrictionsUpdated@0(string window_id, DlpRestrictionSet restrictions);
// Called to evaluate screenshare restriction for a window or full screen.
[MinVersion=1] CheckScreenShareRestriction@1(
ScreenShareArea area, mojo_base.mojom.String16 application_title) =>
(bool proceed);
// Called when screen share in Lacros is started.
[MinVersion=2] OnScreenShareStarted@2(string label, ScreenShareArea area,
mojo_base.mojom.String16 application_title,
pending_remote<StateChangeDelegate> delegate);
// Called when screen share in Lacros is stopped.
[MinVersion=2] OnScreenShareStopped@3(string label, ScreenShareArea area);
};