chromium/ash/public/mojom/hid_preserving_bluetooth_state_controller.mojom

// Copyright 2024 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.mojom;

// Used when recording which surface the HID warning dialog is shown from.
enum HidWarningDialogSource {
  kOsSettings,
  kQuickSettings,
};

// HidPreservingBluetoothStateController interface provides a method to
// enable/disable Bluetooth device state. If only Bluetooth input devices are
// connected, and bluetooth is being disabled a warning dialog is shown,
// informing the user that turning Bluetooth off will disconnect those devices.
interface HidPreservingBluetoothStateController {

  // Attempts to turn Bluetooth on or off. If Bluetooth is unavailable or if it
  // is not currently modifiable, this function is a no-op.
  // If only Bluetooth input devices are connected, and |enabled| is false,
  // shows a dialog warning the user that turning Bluetooth off will disconnect
  // those devices.
  TryToSetBluetoothEnabledState(bool enabled,
                                HidWarningDialogSource source);
 };