naiveproxy/ash/public/interfaces/media.mojom

47 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-12-10 05:59:24 +03:00
// Copyright 2016 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 ash.mojom;
import "components/account_id/interfaces/account_id.mojom";
// Describes whether media is currently being captured.
enum MediaCaptureState {
NONE = 0,
AUDIO = 1,
VIDEO = 2,
AUDIO_VIDEO = 3
};
// Allows clients (e.g. Chrome browser) to interface with the ash media
// indicators.
interface MediaController {
// Sets the client interface.
SetClient(associated MediaClient client);
// Called when the media capture state changes on the client, or in response
// to a RequestCaptureState() request. Returns a map from AccountId to
// MediaCaptureState representing every user's state.
NotifyCaptureState(map<signin.mojom.AccountId,
MediaCaptureState> capture_states);
};
// This delegate allows the UI code in ash to forward UI commands.
interface MediaClient {
// Handles the Next Track Media shortcut key.
HandleMediaNextTrack();
// Handles the Play/Pause Toggle Media shortcut key.
HandleMediaPlayPause();
// Handles the Previous Track Media shortcut key.
HandleMediaPrevTrack();
// Requests that the client resends the NotifyMediaCaptureChanged() message.
RequestCaptureState();
// Suspends all WebContents-associated media sessions to stop managed players.
SuspendMediaSessions();
};