#include "base/memory/raw_ptr.h"
#include "content/browser/media/session/audio_focus_delegate.h"
#include "base/functional/bind.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "content/browser/media/session/media_session_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/media_session_service.h"
#include "media/base/media_switches.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/media_session/public/cpp/features.h"
#include "services/media_session/public/mojom/audio_focus.mojom.h"
namespace content {
AudioFocusType;
namespace {
const char kAudioFocusSourceName[] = …;
base::UnguessableToken GetAudioFocusGroupId(MediaSessionImpl* session) { … }
class AudioFocusDelegateDefault : public AudioFocusDelegate { … };
}
AudioFocusDelegateDefault::AudioFocusDelegateDefault(
MediaSessionImpl* media_session)
: … { … }
AudioFocusDelegateDefault::~AudioFocusDelegateDefault() = default;
AudioFocusDelegate::AudioFocusResult
AudioFocusDelegateDefault::RequestAudioFocus(AudioFocusType audio_focus_type) { … }
void AudioFocusDelegateDefault::AbandonAudioFocus() { … }
std::optional<media_session::mojom::AudioFocusType>
AudioFocusDelegateDefault::GetCurrentFocusType() const { … }
void AudioFocusDelegateDefault::MediaSessionInfoChanged(
const media_session::mojom::MediaSessionInfoPtr& session_info) { … }
void AudioFocusDelegateDefault::ReleaseRequestId() { … }
void AudioFocusDelegateDefault::FinishAudioFocusRequest(AudioFocusType type,
bool success) { … }
void AudioFocusDelegateDefault::EnsureServiceConnection() { … }
std::unique_ptr<AudioFocusDelegate> AudioFocusDelegate::Create(
MediaSessionImpl* media_session) { … }
}