microphone_mute_notification_delegate.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #ifndef ASH_PUBLIC_CPP_MICROPHONE_MUTE_NOTIFICATION_DELEGATE_H_
  5. #define ASH_PUBLIC_CPP_MICROPHONE_MUTE_NOTIFICATION_DELEGATE_H_
  6. #include <string>
  7. #include "ash/public/cpp/ash_public_export.h"
  8. #include "third_party/abseil-cpp/absl/types/optional.h"
  9. namespace ash {
  10. // This delegate exists so that code relevant to microphone mute notifications
  11. // under //ash can call back into //chrome. The actual delegate instance is
  12. // owned and constructed by code in //chrome during startup.
  13. class ASH_PUBLIC_EXPORT MicrophoneMuteNotificationDelegate {
  14. public:
  15. static MicrophoneMuteNotificationDelegate* Get();
  16. // Returns an optional string with:
  17. //
  18. // No value, if no app is accessing the mic
  19. // Empty value, if an app is accessing the mic but no name could be determined
  20. // Non-empty value, if an app is accessing the mic and a name could be
  21. // determined
  22. virtual absl::optional<std::u16string> GetAppAccessingMicrophone() = 0;
  23. protected:
  24. MicrophoneMuteNotificationDelegate();
  25. virtual ~MicrophoneMuteNotificationDelegate();
  26. };
  27. } // namespace ash
  28. #endif // ASH_PUBLIC_CPP_MICROPHONE_MUTE_NOTIFICATION_DELEGATE_H_