chromium/chromeos/ash/services/libassistant/public/mojom/platform_delegate.mojom

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module ash.libassistant.mojom;

import "ash/public/mojom/assistant_volume_control.mojom";
import "chromeos/ash/services/assistant/public/mojom/assistant_audio_decoder.mojom";
import "chromeos/services/network_config/public/mojom/cros_network_config.mojom";
import "media/mojo/mojom/audio_stream_factory.mojom";
import "sandbox/policy/mojom/context.mojom";
import "services/device/public/mojom/battery_monitor.mojom";
import "services/device/public/mojom/wake_lock_provider.mojom";

// Delegate that exposes methods to bind platform related functionality.
[RequireContext=sandbox.mojom.Context.kPrivilegedUtility]
interface PlatformDelegate {

  // Requests an Audio Service AudioStreamFactory from the browser.
  [AllowedContext=sandbox.mojom.Context.kPrivilegedUtility]
  BindAudioStreamFactory(
    pending_receiver<media.mojom.AudioStreamFactory> receiver);

  // Requests an audio decoder interface from the Assistant Audio Decoder
  // service, via the browser.
  BindAudioDecoderFactory(
    pending_receiver<ash.assistant.mojom.AssistantAudioDecoderFactory>
      receiver);

  // Requests Ash's AssistantVolumeControl interface from the browser.
  BindAssistantVolumeControl(pending_receiver<ash.mojom.AssistantVolumeControl>
    receiver);

  // Requests a BatteryMonitor from the browser.
  BindBatteryMonitor(pending_receiver<device.mojom.BatteryMonitor> receiver);

  // Requests a connection to the CrosNetworkConfig service interface via the
  // browser.
  BindNetworkConfig(
    pending_receiver<chromeos.network_config.mojom.CrosNetworkConfig> receiver);

  // Requests a connection to the Device service's WakeLockProvider interface
  // from the browser.
  BindWakeLockProvider(pending_receiver<device.mojom.WakeLockProvider>
    receiver);
};